Closed GoogleCodeExporter closed 9 years ago
In the end I am interested to create a script file that will reboot the router
each day at a specified time.
Thanks
Original comment by Iosif.Za...@gmail.com
on 30 Aug 2014 at 5:13
=)
You forgot to switch 'Use Entware' in web interface.
As for second question: read CommonTips in Wiki. There should be a tip how to
create crontask or smth. like that.
For future, use search tools and read wiki before posting an issue. Thousands
of such questions were discussed long time ago.
Original comment by d...@soulblader.com
on 30 Aug 2014 at 5:27
I didn't forgot. Entware is enabled in the web interface.
not funny
Original comment by Iosif.Za...@gmail.com
on 30 Aug 2014 at 6:07
Aparently I made it work (I have no serious idea how tough).
Related to the reboot script I've found only one link:
https://code.google.com/p/rt-n56u/issues/detail?id=562#c1
Any ideas how can i make it to reboot at a specific hour ?
Thanks.
Original comment by Iosif.Za...@gmail.com
on 30 Aug 2014 at 7:47
You searched in wrong place. I've written about Wiki
https://code.google.com/p/rt-n56u/wiki/CommonTips?wl=en#Using_the_built-in_sched
uler_%28crond%29
specially for you. Add the following to /etc/storage/started_script.sh:
####
crond_env() {
[ -x /usr/sbin/crond ] || return 1
[ -d /var/spool/cron/crontabs ] || mkdir -p -m 700 /var/spool/cron/crontabs
cat > /var/spool/cron/crontabs/admin << EOF
SHELL=/bin/sh
MAILTO=root
HOME=/
30 01 * * * /sbin/reboot
EOF
chmod 600 /var/spool/cron/crontabs/admin
[ -z "`pidof crond`" ] && /usr/sbin/crond
}
crond_env
###
then run:
# mtd_storage.sh save
The line: 30 01 * * * /sbin/reboot means - "execute /sbin/reboot every day at
1:30".
See crontab man for details!
Original comment by d...@soulblader.com
on 30 Aug 2014 at 8:27
Original issue reported on code.google.com by
Iosif.Za...@gmail.com
on 30 Aug 2014 at 5:10