Linux配置定时crontab及环境变量
一、linux配置定时crontab 1、执行方法 a、crontab –e : 修改 crontab 文件,如果文件不存在会自动创建。 b、10 0 . ./.bash_profile;sh /home/zjtxjb_scp1/etc/shell/x.sh c、crontab -l:显示 crontab 文件,查看定时配置。 2、定时含义(参考附件crontab格式说明) 五个参数依次代表的含义分、时、日、月、星期。 3、秒级定时任务执行采取sleep方式,执行的时间间隔要能被60整除,如下例子。也可以把sleep命令写进程序中然后引入程序。 例如: 程序每10s执行一次 . ./.bash_profile;sh /home/zjtxjb_scp1/etc/shell/x.sh sleep 10; . ./.bash_profile;sh /home/zjtxjb_scp1/etc/shell/x.sh sleep 20; . ./.bash_profile;sh /home/zjtxjb_scp1/etc/shell/x.sh sleep 30; . ./.bash_profile;sh /home/zjtxjb_scp1/etc/shell/x.sh sleep 40; . ./.bash_profile;sh /home/zjtxjb_scp1/etc