我有以下腳本:shell腳本 - 啓動碼頭,手動工作正常,但不是通過crontab的
./script.sh.
的問題是:
#!/bin/bash
jettyPid=`pgrep -f solr`
if [ "$jettyPid" == "" ]
then
/etc/init.d/jetty start &
fi
,如果一個執行工作正常如果我把這個cron作業,該碼頭將無法啓動,然而,它記錄到我的日誌文件:
出發碼頭:已開始碼頭週五君...
我不明白爲什麼會發生。
很棒:D工作。非常感謝 – elf