annotate scripts/backup-push @ 97:fb292a0184d9

Add a page about UltraRogue.
author John "Elwin" Edwards
date Mon, 05 Apr 2021 21:57:20 -0400
parents 44cf8c7c2c7a
children
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 BACKUPACCT='rlgbackup@icemonster.rlgallery.org'
90
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
6 NEWDIR=$(date +%Y.%m.%d-%H.%M.%S)
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
7 GAMESOURCE='/var/dgl/var/games/roguelike/'
79
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
90
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
10 if [ -e /etc/rlg-testing ]
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
11 then
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
12 GAMEDEST="$BACKUPACCT:testing/games/$NEWDIR"
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
13 TTYRECDEST="$BACKUPACCT:testing/ttyrecs"
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
14 else
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
15 GAMEDEST="$BACKUPACCT:production/games/$NEWDIR"
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
16 TTYRECDEST="$BACKUPACCT:production/ttyrecs"
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
17 fi
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
18
44cf8c7c2c7a Rearrange some backup locations.
John "Elwin" Edwards
parents: 79
diff changeset
19 rsync -rqz "$GAMESOURCE" "$GAMEDEST"
79
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
20 rsync -rqz -pt "$TTYRECSRC" "$TTYRECDEST"
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
21
ea014ed97581 Add a script for making backups.
John "Elwin" Edwards
parents:
diff changeset
22 exit