1.查看是否安装了crontab
service crond status
2.创建要定时执行的脚本test.sh(注:所有的路径都写绝对路径,包括输出日志的路径,否则执行可能会有问题)
#!/bin/bash echo "大家好" >> /home/kavins.logecho "执行时间为:`date`">>/home/kavins.log
3.配置定时任务: crontab -e
*/1 * * * * sh /home/aaa.sh >> /home/test.sh
* * * * * command | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +------- month (1 - 12) | | +--------- day of month (1 - 31) | +----------- hour (0 - 23) +------------- min (0 - 59)
标签:配置,crontab,sh,linux,home,定时,day From: https://www.cnblogs.com/kavins/p/18151224