Jump to content

Cron Jobs


Ads

Recommended Posts

I am trying to run a cron job every 5 minutes.

 

5 * * * * php5 -f/home/sites/skyytemple/public_html/cron_fivemins.php

 

The cron emails me saying "Could not open input file: /home/sites/skyytemple/public_html/cron_fivemins.php"

 

Im unsure what to do to fix this, as the file is there i can run it manually through entering the URL (I havent secured as i am worrying mroe on trying to get it to work)

 

 

Link to comment
https://forums.phpfreaks.com/topic/197814-cron-jobs/
Share on other sites

Are you sure that is the real and absolute path to the file?  You say you can run it from a url; so add a line to echo the file path (echo __FILE__;) and see what it really is.  Then use that path in the cron job (take that echo statement out of course).

 

If that is the correct filepath, it may be a permissions issue.  I'm not sure how your host works.  I would guess that the file is owned by you (the login you use to upload files), and cron is running the job as you; and you have read access to the file. So it should work.

 

On a side note, do you really want a cron job accessible as a url?  That would mean that anyone with an internet connection can request the file and cause it to be executed.  I would think you want the file in a private area so it is only run by your cron job.

Link to comment
https://forums.phpfreaks.com/topic/197814-cron-jobs/#findComment-1038077
Share on other sites

  • 1 month later...
  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.