summaryrefslogtreecommitdiff
path: root/sh/syncmusic
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-02-21 01:17:24 -0800
committerKai Stevenson <kai@kaistevenson.com>2023-02-21 01:17:24 -0800
commit89f45d9c05240bde3b1a78d92bde47a33d851bcd (patch)
tree04e0cfd4c59c16683a394ea390b1902af8e28ddf /sh/syncmusic
parentfff4b176950deba17da1590f3d5a09fc13b04ba6 (diff)
add syncmusic script
Diffstat (limited to 'sh/syncmusic')
-rwxr-xr-xsh/syncmusic28
1 files changed, 28 insertions, 0 deletions
diff --git a/sh/syncmusic b/sh/syncmusic
new file mode 100755
index 0000000..84c7e5e
--- /dev/null
+++ b/sh/syncmusic
@@ -0,0 +1,28 @@
+REMOTEDIR=root@aberrantflux.xyz:/mnt/blockstorage/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"
+read -p "Direction: " DIRECTION
+
+if [ $DIRECTION = d ]
+then
+ COMMAND="rsync -avzP $REMOTEDIR/* $LOCALDIR/"
+ echo "About to run $COMMAND - enter y to continue, or n to cancel"
+ read -p "Confirm: " 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"
+ read -p "Confirm: " CONFIRMATION
+ if [ $CONFIRMATION = y ]
+ then
+ rsync -avzP $LOCALDIR/* $REMOTEDIR/
+ fi
+fi