summaryrefslogtreecommitdiff
path: root/syncmusic
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-03-13 02:41:09 -0700
committerKai Stevenson <kai@kaistevenson.com>2023-03-13 02:41:09 -0700
commitd25bfbc4b61da3e905750ae9eb70b5c8983135be (patch)
tree3a6a932a5b421d01f5d42cbda918543f0c000521 /syncmusic
parentaca46379f7bbe5d7aa084175b3ad7efe7665c7c3 (diff)
restructured directory
Diffstat (limited to 'syncmusic')
-rwxr-xr-xsyncmusic32
1 files changed, 32 insertions, 0 deletions
diff --git a/syncmusic b/syncmusic
new file mode 100755
index 0000000..4b487c9
--- /dev/null
+++ b/syncmusic
@@ -0,0 +1,32 @@
+#!/bin/sh
+REMOTEDIR=root@canonical.aberrantflux.xyz:/srv/music
+LOCALDIR=$(pwd)
+echo "Remote directory is at $REMOTEDIR"
+echo "Local dir is at $LOCALDIR"
+echo "To sync from remote to local, enter d. To sync from local to remote, enter u. To cancel, enter c"
+printf "Direction: "
+read DIRECTION
+
+if [ $DIRECTION = d ]
+then
+ COMMAND="rsync -avzP $REMOTEDIR/* $LOCALDIR/"
+ echo "About to run $COMMAND - enter y to continue, or n to cancel"
+ printf "Confirm: "
+ read CONFIRMATION
+ if [ $CONFIRMATION = y ]
+ then
+ rsync -avzP $REMOTEDIR/* $LOCALDIR/
+ fi
+fi
+
+if [ $DIRECTION = u ]
+then
+ COMMAND="rsync -avzP $LOCALDIR/* $REMOTEDIR/"
+ echo "About to run $COMMAND - enter y to continue, or n to cancel"
+ printf "Confirm: "
+ read CONFIRMATION
+ if [ $CONFIRMATION = y ]
+ then
+ rsync -avzP $LOCALDIR/* $REMOTEDIR/
+ fi
+fi