测试每周的 cron 作业 [英] Test a weekly cron job
本文介绍了测试每周的 cron 作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 cron.week 目录中有一个 #!/bin/bash
文件.
I have a #!/bin/bash
file in cron.week directory.
有没有办法测试它是否有效?等不及 1 周
Is there a way to test if it works? Can't wait 1 week
我在 Debian 6 上使用 root
I am on Debian 6 with root
推荐答案
做 cron 做的,以 root
运行以下命令:
Just do what cron does, run the following as root
:
run-parts -v /etc/cron.weekly
...如果您收到不是目录:-v"错误,则下一个:
... or the next one if you receive the "Not a directory: -v" error:
run-parts /etc/cron.weekly -v
选项 -v
在运行之前打印脚本名称.
Option -v
prints the script names before they are run.
这篇关于测试每周的 cron 作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文