#!/bin/bash # Of course, copy this to the /bin directory and "chmod 755 /bin/backup.vim" # make a cron # echo "@weekly /bin/backup.vim | mail -s "Homeserv Backup" your@email.com #Rsync backup to usb drive" >> /var/spool/cron/crontabs/root # you will probably need to make a map in postfix so outgoing mail isn't refused by the server # hash:/etc/postfix/canonical_sender # Now make a map for root to root@rcrnet.net #Exclude examples #--exclude "tmp" --exclude "[cC]ache" # --delete (Gets rid of files on destination that are not on the source) # --delete-excluded (Gets rid of any files that already exist on the destination # that you have told rsync to exclude # --exclude=".*/" (excludes hidden files) # Restore example (Just reverse the flow) # cd /home # rsync -e ssh -av ted@nox:/bkp/mononoke/ted . #Now ted@nox:/bkp/mononoke/ted is the source and . (the current directory) is the target. #*********************************************************************************** rsync -av /bin/backup.vim /media/disk/homeserv #Backup localhost home directory rsync -av /home/rodney/ /media/disk/homeserv/user --exclude smb4k/ --exclude=".*/" --delete --delete-excluded #Backup homes exclude recycler and girly rsync -av -e ssh root@homeserv:/home/ /media/disk/homeserv/home --exclude samba/ --exclude RECYCLER --exclude girly/ --exclude .mp3 --delete #cuz girly is special rsync -av -e ssh root@homeserv:/home/girly/ /media/disk/homeserv/home/girly --exclude .toc --exclude RECYCLER --exclude .dat --exclude .mp3 --delete # Backup homeserv iso programs but exclude profiles, mp3 and junk rsync -av -e ssh root@homeserv:/home/samba/ /media/disk/programs --exclude profiles/ --exclude junk/ --exclude mp3/ --exclude netlogon --exclude .mp3 --delete rsync -av -e ssh root@homeserv:/home/samba/netlogon /media/disk/homeserv/netlogon --exclude .mp3 --delete --delete-excluded rsync -av -e ssh root@homeserv:/root/ /media/disk/homeserv/root --exclude .mp3 --delete --delete-excluded