多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
任务计划[cron模块][1] 执行周期的格式说明 `minute,hour,day,month,weekday` ### 建立任务计划 #### 命令行使用格式 ``` ansible node2.test.com -m cron -a "name=test_cron job='/bin/date > /tmp/tmp.time' weekday=6" ansible node2.test.com -m cron -a "name=test_cron job='/bin/date > /tmp/tmp.time' minute='*/10'" ``` 注意job用单引号 #### 查看任务计划 ``` ansible node2.test.com -m shell -a 'crontab -l' #Ansible: test_cron * * * * 6 /bin/date > /tmp/tmp.time ``` #### 删除任务计划 ``` ansible node2.test.com -m cron -a "name=test_cron state=absent" ``` [1]:http://docs.ansible.com/ansible/latest/cron_module.html