本文介绍了测试每周一次的 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
我使用 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 作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!