Skip to content

Instantly share code, notes, and snippets.

@lil5
Last active February 6, 2019 15:57
Show Gist options
  • Save lil5/271a78cc77b668827ee712075159c047 to your computer and use it in GitHub Desktop.
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
#!/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