Skip to content
Snippets Groups Projects
Commit c90651bd authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

if exists, add /data target to backup cron

parent 315400a5
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,8 @@ def setup(interactive=True):
CROND_TEMPLATE = '''# https://github.com/laurent22/rsync-time-backup
0 22 * * * root /usr/local/sbin/rsync_tmbackup.sh /etc root@{backup_server}:/backup/{hostname}/etc /etc/backup/excluded_patterns.txt
0 22 * * * root flock -n /etc/backup/home_backup.lock /usr/local/sbin/rsync_tmbackup.sh /home root@{backup_server}:/backup/{hostname}/home /etc/backup/excluded_patterns.txt'''
if os.path.exists('/data'):
CROND_TEMPLATE += '\n0 22 * * * root flock -n /etc/backup/data_backup.lock /usr/local/sbin/rsync_tmbackup.sh /data root@{backup_server}:/backup/{hostname}/data /etc/backup/excluded_patterns.txt'
# crontab files can only contain lowercase and dashes, no _ or .
cmds = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment