mirror of https://github.com/Chizi123/Scripts.git

Joel Grunbaum
2020-02-15 64e605c546cdcf141ca7d75010ed4f1c4d462f4f
commit | author | age
64e605 1 #!/bin/sh
JG 2
3 cd /home/joel/OneDrive
4
5 LAST="$(duplicacy list | tail -n1 | cut -d' '  -f4)"
6 CURR="$(duplicacy backup | grep "revision [0-9] completed" | sed 's/[^0-9]//g')"
7 #LAST=2
8 #CURR=4
9 DIFF="$(duplicacy diff -r $CURR -r $LAST | grep '-')"
10
11 #echo "curr - $CURR"
12 #echo "last - $LAST"
13 #echo "diff - $DIFF"
14
15 if [ -z "$DIFF" ]; then
16     duplicacy prune -r $CURR -exclusive
17 else
18     echo "No diff to backup"
19 fi
20 duplicacy prune -keep 1:7 -keep 7:30 -exclusive
21
22 BACKUP_DIR="/backup/work/"
23 rclone sync $BACKUP_DIR "OneDrive_Personal":/Uni &
24 rclone sync $BACKUP_DIR "NextCloud":/Uni &
25 rclone sync $BACKUP_DIR "GoogleDrive":/Uni &
26 rclone sync $BACKUP_DIR "Mega":/Uni &
27 rclone sync $BACKUP_DIR "unimelb":/ &
28 rclone sync $BACKUP_DIR "sout":/data/Cloud &
29 #rclone sync $BACKUP_DIR "Oracle":/Uni