Jump to content

Php Cron Job


Recommended Posts

:wallbash:

I am new to this and I do not know how to handle it.

I have installed webcalendar. and it is working however I am trying to make a reminder but the problem is that I can not understand the user manual.

 

The manual mentions that it should be php CGI cron job, and if I can not make it I should a server base cron job. Is there anybody who can give me the lead how to fix this. I am adding the instructions below:

 

To set this up in cron, add a line like the following in your crontab

* to run it every 10 minutes:

* 1,11,21,31,41,51 * * * * php /some/path/here/send_reminders.php

* Of course, change the path to where this script lives. If the

* php binary is not in your $PATH, you may also need to provide

* the full path to "php".

* On Linux, just type crontab -e to edit your crontab.

 

thanks for help, shahram

Link to post
Share on other sites

I just wanted to mention that I have added a cron job in the cpanel:

 

php -q /home/username/public_html/calendar/tools/send_reminders.php > /dev/null

 

I am not sure whether this will do the job or everything is in perfect order. Any suggestion would be great.

Link to post
Share on other sites

cPanel provides 2 ways of entering a cron job. If you are unsure of how to build a cron job I suggest using the STANDARD method and not the ADVANCED.

 

When you select the STANDARD method choose the following from the boxes provided.

 

Every 10 minutes in the minutes box

Nothing selected in the hours box

Everyday in the days box

Every Month in the months box

Every Weekday in the weekday box

 

For your job you can use this:

>/usr/bin/php -q /home/your-cPanel-name/public_html/calendar/tools/send_reminders.php >/dev/null

Link to post
Share on other sites

Thanks. I will try and let you know if there is any problem.

Happy Holidays

 

 

cPanel provides 2 ways of entering a cron job. If you are unsure of how to build a cron job I suggest using the STANDARD method and not the ADVANCED.

 

When you select the STANDARD method choose the following from the boxes provided.

 

Every 10 minutes in the minutes box

Nothing selected in the hours box

Everyday in the days box

Every Month in the months box

Every Weekday in the weekday box

 

For your job you can use this:

>/usr/bin/php -q /home/your-cPanel-name/public_html/calendar/tools/send_reminders.php >/dev/null

Link to post
Share on other sites

I could find the problem in source code and solved it but now I am facing a problem in cron job.

 

I am runing the php file with adress bar http://*****.com/calendar/tools/send_reminders.php

and it sends the reminders and I have set two cron jobs to verify whether it works or not but non works:

 

first one: * * * * * #!/usr/local/bin/php -q /home/ID/public_html/calendar/tools/send_reminders.php > /dev/null

second one: ***** /usr/local/bin/php -q /home/ID/public_html/calendar/tools/send_reminders.php > /dev/null

 

I am just wondering whether I can put the adress in the cron tab or not.

 

Please let me know if you know what the problem is.

 

thanks

Happy Holidays

Link to post
Share on other sites

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.   Paste as plain text instead

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