Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:rsync_backup_script [2014/11/24 22:34] billdozor |
linux_wiki:rsync_backup_script [2019/05/25 23:50] (current) |
||
---|---|---|---|
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** |
+ | * Distro(s): Any | ||
+ | * Other: List of source folders to backup (/ | ||
+ | * Other: Storage mounted somewhere to backup to (/backups/ in this example) | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== The Script ===== | ||
- | <code bash file backup_home.sh> | + | <code bash backuphome.sh> |
#!/bin/bash | #!/bin/bash | ||
Line 23: | Line 32: | ||
</ | </ | ||
- | == Call Backup Script with Cron == | + | ==== Call Backup Script with Cron ==== |
- | Edit your crontab: | + | 1) Edit your crontab: |
<code bash> | <code bash> | ||
crontab -e | crontab -e | ||
</ | </ | ||
- | and schedule | + | 2) Schedule |
<code bash> | <code bash> | ||
# minute (m), hour (h), day of month (dom), month (mon), | # minute (m), hour (h), day of month (dom), month (mon), |