-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup_hp_husker_cyg.sh
More file actions
executable file
·48 lines (36 loc) · 1.44 KB
/
backup_hp_husker_cyg.sh
File metadata and controls
executable file
·48 lines (36 loc) · 1.44 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
42
43
44
45
46
47
#!/usr/bin/env bash
# need to copy to cygwin with
# cp backup_hp_husker_cyg.sh /mnt/c/cygwin64/home/Andrew/scripts
#
if $(id -G | grep -qE '\<(114|544)\>')
then
echo "running as admin"
else
echo "not admin"
exit 1
fi
current_hostname=$(hostname)
expected_hostname="HP2-DiningRoom"
if [[ "$current_hostname" != "$expected_hostname" ]]; then
echo "Hostname is not as expected was: $current_hostname (expected: $expected_hostname)"
exit 1
fi
BACKUP_VOL=husker
BACKUP_DRIVE=f
cd /cygdrive
b_str=$(cat $BACKUP_DRIVE/VOLUME.txt)
if [ "$b_str" != ${BACKUP_VOL} ]; then
echo "/cygdrive/$BACKUP_DRIVE is not ${BACKUP_VOL} volume, is $b_str"
exit 1
fi
RSYNC_CMD='rsync -av --delete --exclude=*RECYCLE.BIN* --no-owner --no-group --ignore-errors'
echo "backup chrome profiles alo"
rsync -av --exclude '*.lnk' --delete --no-owner --no-group "c/Users/Amy/AppData/Local/Google/Chrome/User Data" ${BACKUP_DRIVE}/amy-chrome-profiles
echo "backup firefox"
rsync -av --exclude '*.lnk' --delete --no-owner --no-group c/Users/Amy/AppData/Roaming/Mozilla/Firefox/Profiles/ocrgdcfk.default ${BACKUP_DRIVE}/amy-firefox
echo "backup thuderbird"
rsync -av --exclude '*.lnk' --delete --no-owner --no-group c/Users/Amy/AppData/Roaming/Thunderbird/Profiles ${BACKUP_DRIVE}/amy-thunderbird-email
# copy g drive completely
echo "backup g"
# ${RSYNC_CMD} /cygdrive/g ${BACKUP_DRIVE}/g_drive_copy | delete_dir_lines_from_rsync
${RSYNC_CMD} /cygdrive/g ${BACKUP_DRIVE}/g_drive_copy