local-bin/apsalar/nc-sync

22 lines
409 B
Bash
Executable file

#!/bin/sh
(
if flock -n 9
then
echo 'Lock present, exiting'
exit;
fi
# Needed for cronjob
source /home/siina/.config/private.env
NC_DIR="/home/siina/Nextcloud"
NC_URL="https://cloud.criminallycute.fi"
echo "Nextcloud Sync Syncing ..."
nextcloudcmd -u $NC_USER -p $NC_PASS $NC_DIR $NC_URL
echo "Nextcloud Sync Done syncing"
) 9>'/tmp/nc-sync.lock'
rm -f '/tmp/nc-sync.lock'