Skip to content

Instantly share code, notes, and snippets.

@fgbreel
Created April 6, 2012 04:23
Show Gist options
  • Save fgbreel/2316824 to your computer and use it in GitHub Desktop.
Save fgbreel/2316824 to your computer and use it in GitHub Desktop.
Script de backup
#!/bin/bash
today=$(date '+%Y-%m-%d')
pathdst=/Volumes/backup/bkp-${today}
pathsrc=/Users/gabrielfrancisco/Documents
lastbkp=/Volumes/backup/lastbkp
rsync -avrP --link-dest=${lastbkp} $pathsrc $pathdst
unlink ${lastbkp}
ln -s ${pathdst} ${lastbkp}
echo "Done... destination: ${pathdst} date: ${today}"
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment