annotate do-backup @ 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 489ba6ea3c35
children 737061eac1d0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 #! /bin/sh
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 if [ $# -ne 1 ]; then
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 echo "Usage: $0 <dest>" >&2
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 exit 1
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 elif [ ! -d "$1" ]; then
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 echo "Destination $1 did not exist/was not a directory" >&2
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 exit 1
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 fi
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 DISK="$1"
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 RSYNC_ARGS=${RSYNC_ARGS:-}
23
489ba6ea3c35 Add some more directories to back up
IBBoard <dev@ibboard.co.uk>
parents: 14
diff changeset
13 rsync -av $RSYNC_ARGS --exclude=.thumbnails --exclude=temp --exclude=banshee.db --exclude=.cache --exclude=.local/share/Trash \
27
c7621908cb47 Try to manage disk usage for backup
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
14 --exclude=.local/share/Steam --include=.local/share/Steam/userdata/ --exclude=.SpiderOak \
23
489ba6ea3c35 Add some more directories to back up
IBBoard <dev@ibboard.co.uk>
parents: 14
diff changeset
15 --exclude=.wine --exclude=.wine32 --exclude=.local/share/*/game/ --exclude=.config/Code/ --exclude=.vscode/ --include=Projects/dev \
489ba6ea3c35 Add some more directories to back up
IBBoard <dev@ibboard.co.uk>
parents: 14
diff changeset
16 --include=Projects/master/ --include=Projects/SevenLanguagesInSevenWeeks/ --include=Projects/DoW/ --include=Projects/*.patch --exclude=Projects/* \
489ba6ea3c35 Add some more directories to back up
IBBoard <dev@ibboard.co.uk>
parents: 14
diff changeset
17 /home/ibboard "$DISK"/
27
c7621908cb47 Try to manage disk usage for backup
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
18 rsync -av $RSYNC_ARGS --exclude=Videos/Other --include=Downloads/games --include=Downloads/M4Ps --exclude=Downloads/* --exclude=.Trash-1000 \
c7621908cb47 Try to manage disk usage for backup
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
19 --exclude=.Trash-1001 --exclude=Pictures/PhotoTemp --exclude=Pictures/AlbumArtCollection/ --exclude=Pictures/WarhammerArt/ --include=Pictures/*.xcf \
c7621908cb47 Try to manage disk usage for backup
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
20 --exclude=Pictures/*.* --exclude=VirtualBox/VBoxGuestAdditions* --exclude=SteamExtras/ --exclude=VirtualBox \
c7621908cb47 Try to manage disk usage for backup
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
21 --exclude=Documents/ebooks/mobi --exclude=Documents/ebooks/pdf --exclude=Documents/ebooks/*/mobi --exclude=Documents/ebooks/*/pdf \
c7621908cb47 Try to manage disk usage for backup
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
22 --exclude=Documents/ebooks/Software/videos --exclude=Documents/Games\ Workshop/LivingRuleBooks \
c7621908cb47 Try to manage disk usage for backup
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
23 /mnt/media "$DISK"/
0
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 rsync -av $RSYNC_ARGS /usr/local/bin "$DISK"/
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25