#!/bin/bash # Periodically synchronize NextCloud for externally modified files # Tested with 2017-03-02-raspbian-jessie-lite.img # # Copyleft 2017 by Ignacio Nunez Hernanz # GPL licensed (see end of file) * Use at your own risk! # # Usage: # # ./nc-scan-auto.sh # # See installer.sh instructions for details # More at: https://ownyourbits.com # ACTIVE_=no SCANINTERVAL_=60 DESCRIPTION="Periodically scan NC for externally modified files" show_info() { whiptail --yesno \ --backtitle "NextCloudPi configuration" \ --title "Instructions for auto synchronization" \ "Set the time in minutes in SCANINTERVAL. \n >>> If there are too many files this can greatly affect performance. <<<" \ 20 90 } configure() { [[ $ACTIVE_ != "yes" ]] && { systemctl stop nc-scan.timer systemctl disable nc-scan.timer return 0 } cat > /etc/systemd/system/nc-scan.timer < /etc/systemd/system/nc-scan.service <