annotate scripts/backup-push @ 79:ea014ed97581

Add a script for making backups.
author John "Elwin" Edwards
date Fri, 13 Jan 2017 17:36:23 -0500
parents
children 44cf8c7c2c7a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
79
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
1 #!/bin/sh
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
2 # A backup script for high score lists, log files, saved games, and ttyrecs.
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
3 # Run from cron. Set up SSH keys to BACKUPACCT first.
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
4
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
5 SOURCE='/var/dgl/var/games/roguelike/'
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
6 BACKUPACCT='rlgbackup@icemonster.rlgallery.org'
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
7 NEWDIR=`date +%Y.%m.%d-%H.%M.%S`
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
8 TTYRECSRC=/var/dgl/dgldir/ttyrec/
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
9 TTYRECDEST="$BACKUPACCT:ttyrecs"
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
10
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
11 rsync -rqz "$SOURCE" "$BACKUPACCT:games/$NEWDIR"
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
12 rsync -rqz -pt "$TTYRECSRC" "$TTYRECDEST"
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
13
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
14 exit