今天进度 鸟哥私房菜 - 第十五章、例行性工作排程(crontab)
我在 Crontab.guru - The cron schedule expression editor 练习 crontab 表达式
corntab 的规则如下:
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
crontab -e
开启编辑1 * * * * wall 'HI IT帮'
crontab -l
验证是否有列入排程systemctl restart crond
重启服务test@test:~$ crontab -e # 开启编辑
*/1 * * * * wall 'HI IT帮' # 输入保存
crontab: installing new crontab # 显示正在安装
test@test:~$ crontab -l # 显示目前运行的
*/1 * * * * wall 'HI IT帮'
test@test:~$ systemctl restart crond
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'crond.service'.
Authenticating as: test
Password:
==== AUTHENTICATION COMPLETE ===
Failed to restart crond.service: Unit crond.service not found.
# 等一分钟後
Broadcast message from test@test (somewhere) (Wed Oct 21 01:01:01 2020):
HI IT帮
@reboot touch 路径
测试
test@test:~$ crontab -e
@reboot touch /home/test/start.txt
test@test:~$ reboot
test@test:~$ ls
start.txt
pwd
测试
test@test:~$ pwd
/home/test
我参考 Display the Path of Your Current Directory | Navigating Your File System in Linux | InformIT
一天一Linux,头发远离我 ~
>>: [Golang]GOROOT与GOPATH的说明-心智图
大家好,我是YIYI,今天我要利用MARVEL将前面三个介面做出连结。 制作介面连结 首先,先进入昨...
引述自100Days of Swift-Class inheritance: The second ...
续上一篇文章,写到後面还有一些观念没有讲得很清楚,像是var有Hoisting的特性,coding的...
django - Models 本篇说明 django 使用资料库的方式 以及应用面会使用到的多资料...
「欸!?阿按了这个按钮怎麽没反应阿?」 这是我妈最常问我的问题,大部分情况都是她遥控器忘记装电池。 ...