

Code: Select all
# Default: "rsync://rsync.gentoo.org/gentoo-portage"
# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage"
# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage"
# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage"
# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage"
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
SYNC= "rsync://rsync.europe.gentoo.org/gentoo-portage"


You may be able to avoid the deletion step by using rsync exclude directives to skip copying the files in the first place.Pasketti wrote:But I did notice something. I back everything up to a second hard drive using rsync. When that's done, I delete several directories via rm -rf from the backup drive that don't need to be backed up.
Yeah, I know. It was a tradeoff.Hu wrote:You may be able to avoid the deletion step by using rsync exclude directives to skip copying the files in the first place.
Code: Select all
#!/bin/bash
DATE=`date "+%Y-%m-%d"`
date
# No leading slash on dir name
for DIR in root etc var/bind var/www var/lib/portage opt/msm home
do
echo ============ Backup $DIR
mkdir -p /backup/$DATE/$DIR
rsync -avx --delete --link-dest=/backup/current/$DIR /$DIR/ /backup/$DATE/$DIR
done
rm -f /backup/prev
mv /backup/current /backup/prev
ln -s /backup/$DATE /backup/current