-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup_ssd.sh
More file actions
executable file
·41 lines (30 loc) · 1.07 KB
/
Copy pathbackup_ssd.sh
File metadata and controls
executable file
·41 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/zsh
# backup all laptop files to an external SSD
# differs from backup.ssh due to the laptop containing a partial copy of /Media
DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
SOURCE=/Users/hunter
DEST=/Volumes/SSDBackup
SOURCE_DISK=mac
BACKUP_DISK=ssd
. $DIR/functions.sh
# copy SSH keys to backup without checking
backup --silent $SOURCE/.ssh $SOURCE/Backup
# skipping ssd_media since those files should not change; see validate_ssd.sh
INDEXES=(backup documents development)
# run yabrc update on the source
yabrc_update $SOURCE_DISK $INDEXES pictures raw
# display what will be copied
backup --dry_run $INDEXES pictures partial_raw
ok
# actually copy
backup $INDEXES pictures partial_raw
echo "Complete!"
echo
# run yabrc update on the backup
yabrc_update $BACKUP_DISK $INDEXES images raw
# copy the updated indexes to the backup
backup --silent $SOURCE/Backup/yabrc $DEST/Backup/
# not running yabrc compare here as in backup.sh
# use validate_ssd.sh instead without 'update' to check for changes
# this will check the rest of SSD /Media for changed files
$DIR/validate_ssd.sh