Updates backup script, adds database backup script and modifies extract script

This commit is contained in:
Jonathan Hodgson 2018-07-07 13:42:47 +01:00
parent eb54b254ca
commit 0651268cba
3 changed files with 26 additions and 3 deletions

View file

@ -2,7 +2,7 @@
#Directory on the server to backup to
BACKUPDIR='/mnt/TimeMachine/Backup-JH/backups/'
LATEST=$(ssh officeServerJH find ${BACKUPDIR} -type d -depth 1 | sort | tail -n 1)
LATEST=$(ssh officeServerJH ls ${BACKUPDIR} | sort | tail -n 1)
TODAY=$(date -I -d "today")
echo ${LATEST##*\/}
echo ${TODAY}
@ -17,13 +17,13 @@ fi
#Backup sites directory
rsync --archive --one-file-system --hard-links --human-readable --inplace\
--exclude-from=./backupExcludes\
--link-dest=${LATEST}\
--link-dest=${BACKUPDIR}${LATEST}\
~/Sites officeServerJH:/mnt/TimeMachine/Backup-JH/backups/${TODAY}/ --verbose
#Backup Documents Directory
rsync --archive --one-file-system --hard-links --human-readable --inplace\
--exclude-from=./backupExcludes\
--link-dest=${LATEST}\
--link-dest=${BACKUPDIR}${LATEST}\
~/Documents officeServerJH:/mnt/TimeMachine/Backup-JH/backups/${TODAY}/ --verbose
#At some point, add ability to delete old backups