Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Crontab runs my script but file that are fetched are of 0 kb and when i am running my script scheduled by own i.e ./getMSC.sh $1 $2

its running and files are also fetched Please suggest me why this is hapeening...

share|improve this question
    
It's probably something on line 13. –  Ed Manet Nov 18 '12 at 5:26
add comment

1 Answer

Usually when a script runs properly if run manually, but fails when run from cron by the same user, the problem is a full path not being specified in the script. Your PATH variable for an interactive login session is MUCH bigger than the one your cron job is running under; so where, for example, rsync $source $target might work fine from the command line, when run from cron you should specify the full path: /usr/bin/rsync $source $target instead.

If this isn't helpful, please post back with more detail about what your script is actually doing, and what specific results you're getting.

share|improve this answer
    
Hi,m geeting wht u wnt to say but i have already specified full path in crontab: eg. /user/bin/getmsc.sh abc 10.110.29.10 .Actually in my script inside for loop for every node process of fetching data is running in Bg, but wen it running as cronjob it capturing 0 kb file but wen m running as ./getmsc.sh abs 10.110.29.11 it running fy9..m usuing /Ksh shell in script...pls help me out –  user108904 Nov 19 '12 at 4:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.