Rewrite msync
This commit is contained in:
parent
156b1bd4a6
commit
eadab872a7
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
# Sync files to the main device for categorisation and renaming.
|
# Sync files to the main device for categorisation and renaming.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
while getopts ":pr" o; do
|
while getopts ":pr" o; do
|
||||||
case "${o}" in
|
case "${o}" in
|
||||||
p) ACTION=PUSH ;;
|
p) ACTION=PUSH ;;
|
||||||
@ -25,17 +27,20 @@ if [ $ACTION = RECV ]
|
|||||||
then
|
then
|
||||||
# Move files to the quarantine zone for categorisation and renaming
|
# Move files to the quarantine zone for categorisation and renaming
|
||||||
|
|
||||||
rsync -avPzc gamma:~/storage/pictures/Infinity/ ~/quar && \
|
rsync -avPzc gamma:~/storage/pictures/Infinity/ ~/quar
|
||||||
ssh gamma "rm -I storage/pictures/Infinity/*"
|
|
||||||
|
|
||||||
rsync -avPzc gamma:~/storage/movies/Infinity/ ~/quar && \
|
rsync -avPzc gamma:~/storage/movies/Infinity/ ~/quar
|
||||||
ssh gamma "rm -I storage/movies/Infinity/*"
|
|
||||||
|
|
||||||
rsync -avPzc gamma:~/storage/dcim/Camera/ ~/quar && \
|
rsync -avPzc gamma:~/storage/dcim/OpenCamera/ ~/quar
|
||||||
ssh gamma "rm -I storage/dcim/Camera/*"
|
|
||||||
|
|
||||||
rsync -avPzc "gamma:~/storage/shared/Recordings/Sound records/" ~/quar && \
|
rsync -avPzc "gamma:~/storage/shared/Recordings/Sound records/" ~/quar
|
||||||
ssh gamma "rm -I storage/shared/Recordings/Sound\ records/*"
|
|
||||||
|
rsync -avPzc gamma:~/dr ~/quar
|
||||||
|
|
||||||
|
# Delete remote files
|
||||||
|
|
||||||
|
echo 'rm -rf ~/storage/pictures/Infinity/* ~/storage/movies/Infinity/* ~/storage/dcim/OpenCamera/* "~/storage/shared/Recordings/Sound records/*"' | ssh gamma /bin/sh
|
||||||
|
ssh gamma 'echo > dr'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Kill ssh agent
|
# Kill ssh agent
|
||||||
|
Loading…
Reference in New Issue
Block a user