Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Since both my wife and I use either Mac or Linux based laptops I have a quick and dirty shell script that gets fired off by hand at the end of the day. The script uses rsync and cpio to copy all files in the laptop's home directory onto a machine running debian packed with 4 1TB drives in a RAID5+1 spare configuration. The script uses hard links to keep daily increments without consuming disk space and goes something like:

  # rotate daily backups
  ssh -i $SSHKEY -q $BACKUPHOST rm -rf $BASEDIR/home.3
  ssh -i $SSHKEY -q $BACKUPHOST mv $BASEDIR/home.2 $BASEDIR/home.3
  ssh -i $SSHKEY -q $BACKUPHOST mv $BASEDIR/home.1 $BASEDIR/home.2
  ssh -i $SSHKEY -q $BACKUPHOST \
  "(cd $BASEDIR/home.0 && find . -print | cpio -dplm $BASEDIR/home.1)"

  # backup
  TMPFILE=`mktemp /tmp/excludeXXXXXXXX`
  cat << EOF > $TMPFILE
  quota.user
  .cache
  EOF

  rsync -Lazv -e "ssh -i $SSHKEY" --update --delete \
  --exclude-from=$TMPFILE $HOME $BACKUPHOST:$BASEDIR/home.0

  rm $TMPFILE


So you have a hand rolled version of rsnapshot?: http://www.rsnapshot.org/


Wow, guess so. I've been using my script for years but I'm not surprised someone else has done this right.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: