#!/bin/sh # To run from Internet: # sudo sh -c "$(curl -s http://apps.control2net.com/apt/install-dingo-backup)" # Check if backup script exists echo "Check backup script..." FILE="/opt/GoIoT/DinGo/bin/general/rn_dingo_backup_and_upload.sh" if [ ! -f "$FILE" ]; then # Then download the file echo "Download script file..." cd /opt/GoIoT/DinGo/bin/general/ wget -N "http://apps.control2net.com/apt/misc/RPI/configfiles/general/rn_dingo_backup_and_upload.sh" sudo chmod +x rn_dingo_backup_and_upload.sh fi FILE="/opt/GoIoT/DinGo/bin/general/rn_dingo_backup_and_upload.conf" if [ ! -f "$FILE" ]; then # Then download the file echo "Download config. file..." cd /opt/GoIoT/DinGo/bin/general/ wget -N "http://apps.control2net.com/apt/misc/RPI/configfiles/general/rn_dingo_backup_and_upload.conf" fi # Add schedule to crontab # Check if schedule exists. If not then add it. #echo "Set daily schedule..." #sudo grep -q -F 'rn_dingo_backup_and_upload' /etc/crontab || sudo sed -i -e '$i \15 6 * * * root /opt/GoIoT/DinGo/bin/general/rn_dingo_backup_and_upload.sh\n' /etc/crontab echo "Finished."