netrc for login.
Usage:
- $0 [OPTIONS] source_dir server_url
+ $0 [OPTIONS] source_dir server_url [ARGS...]
$0 -h
OPTIONS:
-s Silent, be less verbose
-t SECS Sync period if nothing changed locally.
Default: 180
+ ARGS Passed to nextcloudcmd
EXAMPLE
- $0 ~/.vimwiki https://cloud.example.com/remote.php/webdav/vimwiki
+ $0 ~/.vimwiki https://cloud.example.com --path vimwiki
EOF
}
SILENT=0
ONESHOT=0
-PERIOD=180
+PERIOD=600
while getopts "host:" OPTION; do
case "${OPTION}" in
SOURCE_DIR=$1
SERVER_URL=$2
+shift
+shift
if [ -z "${SOURCE_DIR}" ] ; then
echo "No source directory given."
exit 1
fi
-NCC_OPTS="${NCC_OPTS} ${SOURCE_DIR} ${SERVER_URL}"
+NCC_OPTS="${NCC_OPTS} $@ ${SOURCE_DIR} ${SERVER_URL}"
while true; do
echo "About to sync..."
After=network-online.target
[Service]
-ExecStart=%h/.local/bin/nextcloud-inotify-sync %h/.vimwiki "https://cloud.example.org/remote.php/webdav/vimwiki"
+ExecStart=%h/.local/bin/nextcloud-inotify-sync %h/.vimwiki "https://cloud.example.com" --path vimwiki
Restart=always
RestartSec=10min