Mercurial > repos > other > usr-local-bin
view 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 |
line wrap: on
line source
#! /bin/bash -e DISK=/run/media/ibboard/backup-linux/ if [ ! -d "$DISK" ]; then echo "Disk not found at $DISK!" >&2 exit 1 fi cp "$(ls -1 /mnt/backup/rsync/installed-packages-*|tail -n1)" "$DISK" rm "$(ls -1 "$DISK"/installed-packages-* | head -n1)" rm -rf $DISK/backup-prev if [ -d "$DISK"/backup ]; then mv $DISK/backup{,-prev} fi mkdir $DISK/backup /usr/local/bin/do-backup "$DISK"/backup/