admin管理员组文章数量:1323798
利用crontab实现树梅派的定时关机
crontab(cron table 命令用于编辑执行中的定期任务列表,并且操作是基于每个用户的,每一个用户(包括 root 用户)都拥有自己的 crontab 。
命令:sudo nano /etc/crontab
编辑crontab在最后添加定时关机命令
编辑之后如下:
实现每天早上7:45关机
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --repo$
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --repo$
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --repo$
45 7 * * * root /sbin/shutdown -h now
#
版权声明:本文标题:树梅派定时关机 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/biancheng/1725891060a1025737.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论