-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackupToBox.sh
executable file
·47 lines (43 loc) · 1.63 KB
/
backupToBox.sh
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
#!/bin/bash
box_dir=~/Box/example.gmail.com
mount $box_dir
mounted=$(mount | grep "$box_dir")
if [ "$mounted" != "" ]; then
~/sendSlackMessage backups rsync "backup to box(example.gmail) started"
paths=("Documents" "Pictures")
for i in "${paths[@]}"; do
rsync -rtDPh --size-only --max-size=250mb --exclude="*.git*" --delete "~/$i/" "$box_dir/$i"
done
~/sendSlackMessage backups rsync "backup to box(example.gmail) ended"
umount $box_dir
fi
box_dir=~/Box/example.yahoo.com
mount $box_dir
mounted=$(mount | grep "$box_dir")
if [ "$mounted" != "" ]; then
~/sendSlackMessage backups rsync "backup to box(example.yahoo) started"
paths=("Music" "Other Music")
for i in "${paths[@]}"; do
rsync -rtDPh --size-only --max-size=250mb --exclude="*.git*" --delete "~/Music/$i/" "$box_dir/$i"
done
~/sendSlackMessage backups rsync "backup to box(example.yahoo) ended"
umount $box_dir
fi
box_dir=~/Box/example.live.com
mount $box_dir
mounted=$(mount | grep "$box_dir")
if [ "$mounted" != "" ]; then
~/sendSlackMessage backups rsync "backup to box(example.live) started"
rsync -rtDPh --size-only --max-size=250mb --exclude="*.git*" --delete "~/Videos/" "$box_dir/Videos"
~/sendSlackMessage backups rsync "backup to box(example.live) ended"
umount $box_dir
fi
box_dir=~/Box/example2.gmail.com
mount $box_dir
mounted=$(mount | grep "$box_dir")
if [ "$mounted" != "" ]; then
~/sendSlackMessage backups rsync "backup to box(example2.gmail) started"
rsync -rtDPh --size-only --max-size=250mb --exclude="*.git*" --delete "~/Pictures/Other Pictures/" "$box_dir/Other Pictures"
~/sendSlackMessage backups rsync "backup to box(example2.gmail) ended"
umount $box_dir
fi