-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup_external_cyg.sh
More file actions
executable file
·40 lines (36 loc) · 984 Bytes
/
backup_external_cyg.sh
File metadata and controls
executable file
·40 lines (36 loc) · 984 Bytes
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
(set -o igncr) 2>/dev/null && set -o igncr; # comment is needed
cd /cygdrive
echo backup_external ...
SOURCE=h
BACK=e
if [ ! -d ${BACK} ]; then
echo Could not find ${BACK} volume
exit 1
else
echo found ${BACK}
fi
if [ ! -d ${BACK}/backup ]; then
echo "Could not find ${BACK}/backup, maybe wrong drive mounted"
exit 1
else
echo found ${BACK}
fi
if [ ! -d ${SOURCE} ]; then
echo Could not find ${SOURCE} volume
exit 1
else
echo found ${SOURCE}
fi
echo "source is $SOURCE backup to $BACK"
echo "backup data"
rsync -av --exclude '*.lnk' --exclude '.canary' --delete --no-owner --no-group $SOURCE/data $BACK/backup | ~/scripts/delete_dir_lines_from_rsync
echo "backup everything on $SOURCE"
rsync -av \
--exclude '*.lnk' \
--exclude=*RECYCLE.BIN* \
--exclude='System Volume Information' \
--exclude='parent.lock' \
--exclude='Cookies-journal' \
--exclude '.canary' \
--delete --no-owner --no-group \
$SOURCE/* $BACK/backup | ~/scripts/delete_dir_lines_from_rsync