测试每周的Cron工作 [英] Test a weekly cron job
本文介绍了测试每周的Cron工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在cron.week目录中有一个#!/bin/bash
文件.
I have a #!/bin/bash
file in cron.week directory.
有没有一种方法可以测试它是否有效?等不及一个星期了
Is there a way to test if it works? Can't wait 1 week
我以root用户身份在Debian 6上
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屋!
查看全文