From 1de5d2478d6d88a57819caf9bf656fe5a27aafef Mon Sep 17 00:00:00 2001 From: DogeyStamp Date: Sat, 15 Jan 2022 18:45:12 -0500 Subject: [PATCH] Add image syncing script --- src/.local/bin/msync | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 src/.local/bin/msync diff --git a/src/.local/bin/msync b/src/.local/bin/msync new file mode 100755 index 0000000..3fcdc79 --- /dev/null +++ b/src/.local/bin/msync @@ -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