开发者

Crontab / shellscript help

I've been trying to get my script to run each day at 06:01 AM.

The script fetches data and outputs it to an .xml file like the following.

#!/bin/sh

tv_grab_se_swedb --days 1 --quiet --output=/www/tv/tv.xml

Priviligies

-rwxrwxrwx  1 root  root     68 Mar  4 10:31 fetchdata.sh*

Now when i run the script it works and I get my output in the .xml file and its a charm.

So i wanted to add this to crontab to run this script everyday..

Crontab entry

# m h  dom mon dow   command
0 6 * * * /www/tv/fetchdata.sh

But somehow the tv.xml is always empty af开发者_C百科ter this script has been ran.

Any solution to this? Have i forgotten something?

-Anders


Check to make sure that tv_grab_se_swedb is in a location that is in the $PATH that cron uses.

Probably nine times out of ten, "unexplainable" errors in cron jobs boil down to path issues.


When you run fetchdata.sh from command line, $PATH variable differs from when thist script runs throught cron.

May be tv_grab_se_swedb can't be found in any of $PATH's and can't be executed

Simpliest solution: rewrite fetchdata.sh with fullpath to tv_grab_se_swedb (something like /usr/local/bin/tv_grab_se_swedb)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜