Difference between revisions of "Rsync backup"
From Noah.org
Jump to navigationJump to searchLine 2: | Line 2: | ||
[[Category:Free_Software]] | [[Category:Free_Software]] | ||
This is the small script I use for online backups with rsync. This includes a one week rotating window. Prior days include only the files that changed, so each day does not take up the full amount of disk. The prior days' backups will appear complete because identical files are hard linked. There's about a hundred versions of this script on the Internet. This one isn't super fancy, but it's small and gets the job done. | This is the small script I use for online backups with rsync. This includes a one week rotating window. Prior days include only the files that changed, so each day does not take up the full amount of disk. The prior days' backups will appear complete because identical files are hard linked. There's about a hundred versions of this script on the Internet. This one isn't super fancy, but it's small and gets the job done. | ||
+ | |||
+ | == crontab == | ||
To use this script add something similar to the following line to /etc/crontab: | To use this script add something similar to the following line to /etc/crontab: | ||
+ | |||
01 4 * * * backup /usr/bin/rsync_backup /media/shareddocs /home/backup | 01 4 * * * backup /usr/bin/rsync_backup /media/shareddocs /home/backup | ||
== rsync_backup script == | == rsync_backup script == | ||
− | + | Click here to download: [http://www.noah.org/downloadsvn.php?src=file:///home/svn/src/shell/rsync_backup rsync_backup] | |
− | + | <include svncat src="file:///home/svn/src/shell/rsync_backup" highlight="sh" /> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | == Ken's exclude.list file == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | My friend, Ken, uses this rsync exclude list. | |
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> |
Revision as of 19:46, 28 January 2008
This is the small script I use for online backups with rsync. This includes a one week rotating window. Prior days include only the files that changed, so each day does not take up the full amount of disk. The prior days' backups will appear complete because identical files are hard linked. There's about a hundred versions of this script on the Internet. This one isn't super fancy, but it's small and gets the job done.
crontab
To use this script add something similar to the following line to /etc/crontab:
01 4 * * * backup /usr/bin/rsync_backup /media/shareddocs /home/backup
rsync_backup script
Click here to download: rsync_backup <include svncat src="file:///home/svn/src/shell/rsync_backup" highlight="sh" />
Ken's exclude.list file
My friend, Ken, uses this rsync exclude list.
### tmp ### - **/tmp/** ### transient ### - /proc/ - /mnt/ - /cdrom/ - /media/ - /sys/ - /var/run/ - /var/lock/ - /var/log/ - /var/tmp/ - /dev/ ### config ### - /etc/adjtime - /etc/motd - /etc/mtab - /etc/resolv.conf - /etc/lvm/.cache - /var/lib/alsa/asound.state - /var/lib/dhcp3/dhclient.*.leases - /var/lib/urandom/ - /var/lib/urandom/random-seed ### apps ### # firefox - **/.mozilla/firefox/*.default/Cache/** # bash - .bash_history # svn - .svn/ - .svn/** # vim - .viminfo - .*.swp # X + .cache/sessions/ - .cache/sessions/** - .xsession-errors - .ICEauthority - .serverauth.* # less - .lesshst ### backup ### - *~