Jump to content

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...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.