我想(在Mac OS X的終端)運行一個簡單的crontab如何知道Crontab是否工作?
我的cronjob事情是這樣的:
* * * * * /Users/tanavya.dimri/Documents/cron.sh
cron.sh:
#!/bin/bash
cd /Users/tanavya.dimri/Documents
python hello.py > empty
而且hello.py簡直就是
print "Hello"
當我剛運行sh cron.sh
它的作品。空,這只是一個空文本文件,確實會變成「Hello」。 但是,我真的不知道它是否與crontab一起工作,因爲在我從中刪除hello後文件不會改變。
刪除文件後嘗試。如果crontab運行,它應該創建它。 – sabbahillel
該con不會知道'.bashrc'的'.profile'中的設置。也許你錯過了一些東西,比如改變PATh,所以可以找到pythom。 –