【发布时间】:2013-12-03 10:23:44
【问题描述】:
我正在尝试备份 crontab 条目结构和在 crontab 下运行的文件。
但我不知道如何在 crontab -l 中搜索文件并复制在其下运行的脚本。
我可能的方法
我已经列出了
crontab -l > test.txt
cat test.txt
但是列表后如何搜索文件。
我的条目是这样的:
# daily pingback report
30 1 * * * php /var/opx/cron-script/daily-email-reports/pingback_report.php | curl --data-binary @- https://pxc.com/email/send
# --------------------------------------------------------------------------------------------------
# daily jobs 02+ hours
# --------------------------------------------------------------------------------------------------
# daily Failed Device Search
0 2 * * * /var/opx/cron-script/failed_device_search.sh
# daily Device Not Detected (we are not getting any of these, so commenting out)
# 5 2 * * * /var/opx/cron-script/device_not_detected.sh
# daily Failed App Search (we are not getting any of these, so commenting out)
# 10 2 * * * /var/opx/cron-script/failed_app_search.sh
# daily oss event report (uncomment when dev db issue is fixed)
10 3 * * * /var/opx/cron-script/event-analysis/daily-oss-event-report
# Copy tomcat logs from s1 and s2 , compress them and move to S3 storage
#30 21 * * * /var/opx/cron-script/log_backup.sh
我想复制在这些条目中运行的脚本。
【问题讨论】: