I would like to setup an scheduled task to deactivate and reactivete the surveillance center app every 2 days.
How can I do this?
It is currently Sat Jan 16, 2021 11:50 pm
All times are UTC + 8 hours
shezhar wrote:I would like to setup an scheduled task to deactivate and reactivate the surveillance center app every 2 days.
How can I do this?
# Every 1AM restart Surveillance Center if enabled
0 1 * * * apkg --info-installed nvr|grep -q 'Enabled: Yes' && { apkg --disable nvr && sleep 20 && apkg --enable nvr; }
crontab -l|tee asustor-old.cron asustor-new.cron
vi asustor-new.cron
crontab < asustor-new.cron
# Every 1AM restart Surveillance Center if enabled
0 1 * * * apkg --info-installed nvr|grep -q 'Enabled: Yes' && /volume1/.@plugins/AppCentral/nvr/CONTROL/start-stop.sh restart
touch /usr/var/restartnvr.sh
vi /usr/var/restartnvr.sh
#!/bin/sh
apkg --disable nvr
sleep 20
apkg --enable nvr
sudo crontab -e
0 2 */2 * * /usr/bin/sh /usr/var/restartnvr.sh
Hope this direction wont be updated, and the file deleted
Users browsing this forum: No registered users and 2 guests