From 619baf69372953525acc0479ac9d385ceb5e7b62 Mon Sep 17 00:00:00 2001 From: DogeyStamp Date: Sat, 19 Mar 2022 15:35:01 -0400 Subject: [PATCH] Add another folder to msync --- src/.local/bin/msync | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/.local/bin/msync b/src/.local/bin/msync index 450b279..036b24a 100755 --- a/src/.local/bin/msync +++ b/src/.local/bin/msync @@ -9,20 +9,25 @@ while getopts ":pr" o; do esac done + +# Setup ssh agent to avoid repeated password prompts +eval `ssh-agent -s` + +ssh-add ~/.ssh/keys/beryllium + if [ $ACTION = PUSH ] then rsync -avPzc ~/med/memes/woof/ boron:~/med/memes/woof + rsync -avPzc ~/med/memes/woof/ beryllium:~/med/memes/woof + + rsync -avPzc --delete ~/med/mus/ beryllium:~/storage/music/mus fi if [ $ACTION = RECV ] then # Move files to the quarantine zone for categorisation and renaming - # Setup ssh agent to avoid repeated password prompts - eval `ssh-agent -s` - ssh-add ~/.ssh/keys/beryllium - rsync -avPzc beryllium:~/storage/pictures/Infinity/ ~/med/memes/woof/quar && \ ssh beryllium "rm -I storage/pictures/Infinity/*" @@ -30,5 +35,6 @@ then ssh beryllium "rm -I storage/movies/Infinity/*" # Kill ssh agent - kill $SSH_AGENT_PID fi + +kill $SSH_AGENT_PID