User Tools

Site Tools


daily_and_weekly_backup_with_rsync

This is an old revision of the document!


Daily and Weekly Backup with Rsync

| backup-cron.sh
#!/bin/bash
#exclude file will contain strings or directories that should not be archived:
#euroco/*
#lithium/*
#jason/stealthii/*
#logs
 
DAY=$(/bin/date +%m%d%y)
DOW=$(/bin/date +%u)
 
if [ $DOW == '7' ]; then
 
        /usr/bin/rsync -a --delete --inplace --exclude-from '/root/exclude' /home /media/backup/stealthsrv/weekly-$DAY
else
        /usr/bin/rsync -a --delete --inplace --exclude-from '/root/exclude' /home /media/backup/stealthsrv/daily
fi
daily_and_weekly_backup_with_rsync.1244128198.txt.gz ยท Last modified: 2020/08/10 02:29 (external edit)