1、打開定時任務文件夾
[root@localhost cron]# cd /var/spool/cron
定時執行shell腳本?[root@localhost cron]#
2、查看定時任務
[root@localhost cron]# crontab -l
linux定時任務指定用戶。0 19 17 12 * /emqx/test0.sh
0 19 17 12 * /emqx/test1.sh
0 19 17 12 * /emqx/test2.sh
shell定時任務,0 19 17 12 * /emqx/test3.sh
0 19 17 12 * /emqx/test4.sh
0 19 17 12 * /emqx/test5.sh
linux定時任務的步驟、0 19 17 12 * /emqx/test6.sh
0 19 17 12 * /emqx/test7.sh
0 19 17 12 * /emqx/test8.sh
linux定時任務每天0點執行,0 19 17 12 * /emqx/test9.sh
3、寫腳本
touch test0.sh
chmod 777 test0.sh
vim test0.sh
sysctl -w net.ipv4.ip_local_port_range=“500 65535”
echo 1000000 > /proc/sys/fs/nr_open
ulimit -n 100000
/data/emqtt-bench/emqtt_bench conn -h 192.168.1.1 -p 1883 -c 50000 --ifaddr 192.168.1.2
4、執行定時任務
crontab -e
0 19 17 12 * /emqx/test0.sh
5 crontab文件格式:
* * * * command
minute hour day month week command
分 時 天 月 星期 命令
6、刪除定時任務
crontab -r
7、查看、設置開機自啟
systemctl list-unit-files crond
systemctl enable crond
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态