-2

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?

Starfish
  • 2,735
  • 25
  • 28
zozo
  • 783
  • 3
  • 11
  • 22

1 Answers1

0

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!

rems
  • 2,260
  • 13
  • 11