summaryrefslogtreecommitdiff
path: root/sh/syncmusic
blob: 84c7e5ed6c9c617256ed57add6b0a49e9179f9f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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