2017-07-07 81 views
0

我想每兩分鐘執行一次Perl腳本。腳本沒有輸出在crontab下運行

此腳本向我發送包含文件的電子郵件。它工作正常手動。

我試着在一個crontab

*/2 * * * * /sw/freetools/perl/5.8.8/Linux/rh6/x86_64/bin/perl /home/httpldev/iLicoMetrics/metrique.pl &> /dev/null 

我也試圖與

*/2 * * * * /home/httpldev/iLicoMetrics/metrique.pl &> /dev/null 

,但我沒有輸出。

+3

您應該嘗試將執行的輸出重定向到一個文件而不是'/ dev/null',這樣您就可以從它可能包含的錯誤消息中找出答案。 – Aaron

+1

[cron tag wiki](https://stackoverflow.com/tags/cron/info)具有出色的調試信息,您有看過嗎? –

+0

謝謝大家,我解決了這個問題 – maha

回答

3

我發現我的錯誤,我做在Perl的路徑錯誤: /sw/freetools/perl/5.8.8/Linux/rh6/x86_64/bin/perl

/SW/freetools/perl的/5.8.8/Linux/rh60/x86_64/bin/perl

謝謝你的幫忙。