-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdiffsplit
More file actions
executable file
·21 lines (19 loc) · 954 Bytes
/
diffsplit
File metadata and controls
executable file
·21 lines (19 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
# rclone dedupe skip $1 -vP
# rclone dedupe skip $2 -vP
# Generally dedupe is not required. But if you get a 'parent' or other error, try running dedupe on source and destination
echo STARTING DIFFSPLIT;echo
rclone check $2 $1 --size-only --one-way --fast-list > check.log 2>&1
awk 'BEGIN { FS = ": " } /ERROR/ {print $2}' check.log > diffsplit.txt
echo Number of files to be moved
num_files=`cat diffsplit.txt | wc -l`
echo $num_files
[ $num_files -gt 0 ] && {
dest="${2%%:*}:backup/${2#*:}"
rclone mkdir $dest
echo -e "Moving files which are in $2 but not in $1 to $dest"
rclone move --files-from diffsplit.txt $2 $dest -vP --stats=10s --drive-use-trash=false --drive-server-side-across-configs=true \
--tpslimit=4 --tpslimit-burst=32 --transfers 32 --checkers=32 --use-mmap --max-backlog=2000000
rm check.log diffsplit.txt; }
echo DIFFMOVE FINISHED moving differential files from $2 to $dest ;echo
# /opt/sasync/utils/sizeup $2