Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 30th, 2012  |  syntax: Bash  |  size: 0.33 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #Copy it to /usr/bin/backup, make it executable
  2. # Call it like "backup filename", it can back up anything
  3.  
  4. # Change these
  5. host=roryholland.co.uk
  6. user=ec2-user
  7. directory=/home/ec2-user/backups
  8.  
  9. # Don't change these
  10. filename="$1-$(date +%F).tar.gz"
  11. tar czvf $filename $1
  12. rsync -ave ssh $filename "$user@$host:$directory/$1"