
Untitled
By: a guest on
Apr 30th, 2012 | syntax:
Bash | size: 0.33 KB | hits: 20 | expires: Never
#Copy it to /usr/bin/backup, make it executable
# Call it like "backup filename", it can back up anything
# Change these
host=roryholland.co.uk
user=ec2-user
directory=/home/ec2-user/backups
# Don't change these
filename="$1-$(date +%F).tar.gz"
tar czvf $filename $1
rsync -ave ssh $filename "$user@$host:$directory/$1"