Mercurial > repos > other > usr-local-bin
view backup-to-disk @ 27:c7621908cb47
Try to manage disk usage for backup
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 07 Mar 2020 16:37:38 +0000 |
parents | faa17dcc2c95 |
children |
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 # Sacrifice the Windows game installers to free up space # We should be fine, but it everything fails between now # and backup completion then they're big but least important rm -rf $DISK/backup-prev/media/Downloads/games/Windows # Ditto the Games Workshop documents rm -rf $DISK/backup-prev/media/Documents/Games\ Workshop/ /usr/local/bin/do-backup "$DISK"/backup/