赞
踩
Cron will work very well for this.
You need first to find the complete path to the shutdown command:
- a@ubuntu:~$ which shutdown
- /usr/sbin/shutdown
Knowing the path to the shutdown
command, you can add the below line (with tweaks) to the end of /etc/crontab
:
30 23 * * * root /usr/sbin/shutdown -h now
At 23:30 (11:30 PM), the kiosk will shut down. No matter what user is logged in, the shutdown command runs as root.
(If you don't want to use the global crontab, log in as root and use crontab -e
. Use the same above syntax without the root
).
Cron Format:
MM HH DD OO WW command
MM
: Minute, 0-59HH
: 24-hour hourDD
: Day of monthOO
: MonthWW
: Day of Week (Sunday is 0, Monday is 1)command
: Self-explanatory
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。