Skip to content

Instantly share code, notes, and snippets.

@xeron
Created July 13, 2010 17:39
Show Gist options
  • Save xeron/474219 to your computer and use it in GitHub Desktop.
Save xeron/474219 to your computer and use it in GitHub Desktop.
#!/bin/bash
USER=backups
REMOTE_SERVER=example.com
PORT=22
BACKUP_DIR=/home/backups
echo "rsync -a -r --delete $BACKUP_DIR/current/ $BACKUP_DIR/old" | ssh $USER@$REMOTE_SERVER
rsync -a -r --delete --rsh "ssh -p$PORT" /home/webmaster $USER@$REMOTE_SERVER:$BACKUP_DIR/current/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment