I've looked for incremental backups that don't require root before, but I finally found it. Similar to rdiff-backup is a program called duplicity. It uses tar, gpg, and the rsync algorithm to store encrypted differential backups.
duplicity needs to be scripted a little bit to automate the backups. I came up with a script that will backup certain directories fully once a week and incrementally the rest of the week. I also disabled the encryption since the transfer method is secure (ssh in my case) and the end server is trusted. If you were using Amazon's S3 service or a public FTP share you might want to tweak this a bit.
/etc/cron.d/backup
32 3 * * 1-6 root /usr/local/sbin/backup.sh<br />32 3 * * 0 root /usr/local/sbin/backup.sh --full
/usr/local/sbin/backup.sh
1 | #!/bin/bash<br /><br />v="-v0 --no-print-statistics"<br />cmd=""<br />duplicity="duplicity"<br />opt="--no-encryption --volsize 100"<br />dest="scp://taonas@thor.home.silfreed.net"<br />maxage="1M"<br />PASSPHRASE=<br />export PASSPHRASE<br /><br />for arg in $@; do<br /> [[ $arg == "-v" ]] && v="-v4"<br /> [[ $arg == "--full" ]] && cmd="full"<br />done<br /><br />dcmd_backup="$duplicity $cmd $opt $v"<br />dcmd_age="$duplicity remove-older-than $maxage $opt $v --force"<br /><br /># backups<br />$dcmd_backup /etc $dest/etc<br />$dcmd_backup /var/log $dest/var-log<br />$dcmd_backup /home \<br /> --exclude /home/silfreed/tmp \<br /> --exclude /home/silfreed/src/silfreednet/tmp \<br /> --exclude /home/silfreed/src/workspace \<br /> --exclude /home/silfreed/src/mozdev/workspace \<br /> --exclude /home/silfreed/.thunderbird/7g3nnt02.default/ImapMail \<br /> $dest/home<br /><br />mysqldump_dir=/tmp/mysqldump<br />mkdir $mysqldump_dir && \<br /> chmod 700 $mysqldump_dir && \<br /> mysqldump -u root -A > $mysqldump_dir/mysqldump.sql && \<br /> $dcmd_backup $mysqldump_dir $dest/mysql<br />rm -rf $mysqldump_dir<br /><br /># age out paths<br />for path in /etc /var-log /home /mysql; do<br /> $dcmd_age $dest$path<br />done
|