1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 21:18:36 -06:00
random/crontab-bk_server.sh

17 lines
484 B
Bash
Raw Normal View History

2022-09-17 22:09:13 -05:00
#!/bin/sh
# this is a script to backup crontab data
# This is the version for my home server
# put this inside /etc/cron.daily
# define location for output
DIR=/mnt/storage/Documents/Backup/pkglists_server
# make sure that the folder exists
mkdir -p $DIR
ls /etc/cron.hourly/ /etc/cron.daily/ /etc/cron.weekly/ /etc/cron.monthly/ > $DIR/crontab
echo "-----------------" >> $DIR/crontab
find /var/spool/cron/ -type f -exec sh -c "echo {} && cat {} && echo ---" \; >> $DIR/crontab