Add image syncing script

This commit is contained in:
dogeystamp 2022-01-15 18:45:12 -05:00
parent 557afc7b7e
commit 1de5d2478d
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

23
src/.local/bin/msync Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
# Sync certain files between all my devices, with this one being the central point.
while getopts ":pr" o; do
case "${o}" in
p) ACTION=PUSH ;;
r) ACTION=RECV ;;
esac
done
if [ $ACTION = PUSH ]
then
rsync -avPzc ~/med/memes/woof/ boron:~/med/memes/woof
rsync -avPzc ~/med/memes/woof/ beryllium:~/med/memes/woof
fi
if [ $ACTION = RECV ]
then
# Move files to the quarantine zone for categorisation and renaming
rsync -avPzc beryllium:~/storage/pictures/Infinity/ ~/med/memes/woof/quar && \
ssh beryllium "rm -I storage/pictures/Infinity/*"
fi