Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have created a cron job in cpanel. The result is this:

*   *   *   *   *   /usr/local/bin/wget http://example.com/facturi-restante/cron

The problem is that is not working. Can anyone give me a hint why please?

share|improve this question
    
Check command manual. Use ssh to connect server and run command "/usr/local/bin/wget ..." –  alvosu Feb 9 '11 at 10:54
    
you cron job is to wget ? or download it and run the file cron ? Regards, Sim –  Sim Feb 9 '11 at 11:27
    
I want to run a script at a specified url. –  zozo Feb 9 '11 at 11:27
add comment

1 Answer

up vote 0 down vote accepted

With your cron entry, specifying no minutes, hours or anything, cron will run EVERY DAY, EVERY HOUR and EVERY MINUTE, starting wget to download the file from the URL passed to wget.

It will not execute that script, just download it. If you want to download and execute it you must do something like:

/usr/local/bin/wget http://example.com/facturi-restante/cron && sh cron

But check to which directory it gets downloaded. Better would be to write these commands in a small shell script and execute that script:

MY_DIR="some_existing_dir"
cd $MY_DIR
/usr/local/bin/wget http://example.com/facturi-restante/cron
[ -f cron ] && sh cron

and in the crontab file just execute the above script. But set the times you want it to run, you probably don't want it to run every minute!

share|improve this answer
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.