This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
daily_and_weekly_backup_with_rsync [2009/06/04 15:09] k2patel created |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== Daily and Weekly Backup with Rsync ==== | ||
- | <code bash | 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 | ||
- | |||
- | </code> |