FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Using Cron via PHP CLI Executable
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Using Cron via PHP CLI Executable [message #166020] Mon, 05 September 2011 03:22 Go to next message
Anik is currently offline  Anik
Messages: 36
Registered: August 2011
Location: India
Karma: 0
Member
add to buddy list
ignore all messages by this user
Hello there,

i tried to schedule tasks via fud forums job panel,
when i put there /usr/bin/php or /usr/local/bin/php none of get worked..

so i looked to this page http://cvs.prohost.org/index.php/Job%20Administration%20System#PHP_CLI_Exec utable and run this command on ssh
$ which php
to find the path but it says that command not found..
is there any command to find th path of php cli?
or did i have to install anything manually using yum? if ys then how?

or if i want to schedule cron via my control panel (server) then what will be the command for this?

Regards,
Re: Using Cron via PHP CLI Executable [message #166021 is a reply to message #166020] Mon, 05 September 2011 03:47 Go to previous messageGo to next message
Anik is currently offline  Anik
Messages: 36
Registered: August 2011
Location: India
Karma: 0
Member
add to buddy list
ignore all messages by this user
is set this on my srver control panel, but things doesn't get worked..

/home/admin/domain.tld/forums/scripts/cron.php
Re: Using Cron via PHP CLI Executable [message #166039 is a reply to message #166021] Tue, 06 September 2011 11:39 Go to previous messageGo to next message
Anik is currently offline  Anik
Messages: 36
Registered: August 2011
Location: India
Karma: 0
Member
add to buddy list
ignore all messages by this user
anyone please..
Re: Using Cron via PHP CLI Executable [message #166694 is a reply to message #166039] Fri, 10 February 2012 15:32 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user

You don't have the php CLI tool it seems.
What OS is that you are running?

We can check in the package manager which package you need once you tell me the OS you have there.

HTH
Re: Using Cron via PHP CLI Executable [message #166695 is a reply to message #166694] Fri, 10 February 2012 15:42 Go to previous message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user

For those that are interested in this matter and have php on the CLI working.
For me to get this working I did this:

As I couldn't su t the web user I had to change some permissions to run cron.php in a cron job.

In <FUDforum data>/scripts/ I chmod'd a few files to (666 or Read + Write for all 3 levels) in the Admin Control panel (so as web user)

The log files from my jobs:

xmlagg.php_1.log
acp.php_3.log


Also in that folder make sure "cron.php" is executable by all too.

Then over in: <FUDforum data>/

errors/LAST_CRON_RUN


This file is touched when cron.php is run so the next time it is run it knows when it was last run.

So now with that set to 666 and cron.php executable by all any user can run cron.php
Not ideal but the only way without root access on the machine.

Then I added the job into the users crontab (I use vim but people might find nano easier, so..)

export EDITOR=nano crontab -e


The paste in:

0 * * * * /<FUDforum data>/scripts/cron.php


And also add to the top of that crontab

MAILTO=<my email address>


So now you get updates of when it runs. Ideal only email when something happens. So to prevent the "Nothing to run" email every hour I commented out line 67 in the cron.php file:
//echo date('d M Y H:i:s') .": Nothing to run.\n";


There, done!

[Updated on: Fri, 10 February 2012 15:43]

Report message to a moderator

Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Anonymous access level
Next Topic: Edit Banner Theme Color
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Oct 22 02:39:16 EDT 2017

Total time taken to generate the page: 0.00740 seconds