Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
linux_wiki:rsync_backup_script [2014/11/20 19:28] 127.0.0.1 external edit |
linux_wiki:rsync_backup_script [2015/03/09 22:09] billdozor |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Rsync Backup Script ====== | ====== Rsync Backup Script ====== | ||
+ | |||
+ | **General Information** | ||
This script backs up a home folder to a backup folder. | This script backs up a home folder to a backup folder. | ||
Line 5: | Line 7: | ||
Lastly, it removes log files that were last modified more than 7 days ago. | Lastly, it removes log files that were last modified more than 7 days ago. | ||
- | == backuphome.sh | + | **Checklist** |
+ | * List of source folders to backup (/ | ||
+ | * Storage mounted somewhere to backup to (/backups/ in this example) | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== The Script ===== | ||
- | < | + | < |
#!/bin/bash | #!/bin/bash | ||
Line 23: | Line 31: | ||
</ | </ | ||
- | == Call Backup Script with Cron == | + | ==== Call Backup Script with Cron ==== |
- | Edit your crontab: | + | 1) Edit your crontab: |
- | < | + | < |
crontab -e | crontab -e | ||
</ | </ | ||
- | and schedule | + | 2) Schedule |
- | < | + | < |
# minute (m), hour (h), day of month (dom), month (mon), | # minute (m), hour (h), day of month (dom), month (mon), | ||
# and day of week (dow) or use ' | # and day of week (dow) or use ' |