Mercurial > repos > other > usr-local-bin
annotate backup-to-disk @ 10:4158847b0f18
Back up additional websites that are in Mercurial
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 31 Aug 2016 17:20:08 +0100 |
parents | e85e3470a41e |
children | faa17dcc2c95 |
rev | line source |
---|---|
0 | 1 #! /bin/bash -e |
2 | |
3 DISK=/run/media/ibboard/backup-linux/ | |
4 | |
5 if [ ! -d "$DISK" ]; then | |
6 echo "Disk not found at $DISK!" >&2 | |
7 exit 1 | |
8 fi | |
9 | |
10 cp "$(ls -1 /mnt/backup/rsync/installed-packages-*|tail -n1)" "$DISK" | |
11 rm "$(ls -1 "$DISK"/installed-packages-* | head -n1)" | |
12 rm -rf $DISK/backup-prev | |
13 if [ -d "$DISK"/backup ]; then | |
14 mv $DISK/backup{,-prev} | |
15 fi | |
16 mkdir $DISK/backup | |
17 /usr/local/bin/do-backup "$DISK"/backup/ | |
18 |