Last active
February 6, 2019 15:57
-
-
Save lil5/271a78cc77b668827ee712075159c047 to your computer and use it in GitHub Desktop.
Webdav equivalent to `rsync -ar --delete remote/folder ./local/`, Copies from Webdav and only sends changes, One way sync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -s PASS | |
if [[ -z $PASS ]]; then | |
echo 'blank password' | |
exit 1 | |
fi | |
USER='user' | |
URL='https://gekko.fritz.box/webdav/user/Music/' | |
CUTDIRS=`expr $(echo $URL | grep -o '\/[^\/][^\/]*' | wc -l) - 2` | |
pushd /mnt/icedragon/GekkoSync | |
wget -o ./${0%.*}.log -r --no-parent -nH --no-clobber --reject=index.html* --cut-dirs=$CUTDIRS --user=$USER --password=$PASS $URL | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment