如何知道Crontab是否有效?

2024-09-24 22:20:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我试着运行一个简单的crontab(在mac OSX终端上)

我的亲信是这样的:

* * * * * /Users/tanavya.dimri/Documents/cron.sh

克罗恩·什:

#!/bin/bash
cd /Users/tanavya.dimri/Documents
python hello.py > empty

而hello.py只是

print "Hello"

当我运行sh cron.sh时,它就工作了。空的,只是一个空的文本文件,会被改成“Hello”。 但是,我不知道它是否与crontab一起工作,因为在删除hello之后,文件不会改变。


Tags: py终端hellobinmacshusersdocuments