• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how can i check cron tab log

#1
[eluser]Angel Lay[/eluser]
Hello

I want to create cronjob that i never try before.

I created cron.php. The content is below:
Code:
<?php
$url = 'http://test.com/controller/method';
file_get_contents($url);
?>

reference : http://ellislab.com/forums/viewthread/201824/#995592

The things i have done in crontab
/usr/bin/php -q /var/.../myroot/cron.php

But, it seems not working.Is there anything wrong?
how can i check log or something else that show the error?
I use Plesk Control Panel.

Thanks.

#2
[eluser]vrencianz[/eluser]
Maybe this helps: http://ellislab.com/forums/viewthread/215821/

Also you can use

Code:
/usr/bin/php -q /var/.../myroot/cron.php 2>&1 >> /var/log/your_log.log

To redirect all output (errors and echoes) to the /var/log/your_log.log file


#3
[eluser]Angel Lay[/eluser]
Unfortunately It still can't work.

#4
[eluser]weboap[/eluser]
what i have done before and worked for me is :

created the the controller thats supposed to do some job

i take your example : http://test.com/controller/method


then in the cron job you will have to reference it by its real path

eg : /home/~username/public_html/application/controllers/controller/method


that will give :
Code:
php -q /home/~username/public_html/application/controllers/controller/method 2>&1 >> /var/log/your_log.log


and it's important that the cron job run as the user owner of the file.
hope it help.



#5
[eluser]Angel Lay[/eluser]
mystructure is
eg : /home/~username/public_html/mysubfolder/mysubfolder2/mycodeigniter/system/application/controllers/controller/method


I tried as below:

Code:
php -q /home/myroot/~username/mysubfolder/cron.php 2>&1 >> /var/log/my_log.log
or
php -q /home/~username/myroot/mysubfolder/cron.php 2>&1 >> /var/log/my_log.log

Code:
php -q /home/~username/myroot/mysubfolder/mysubfolder2/mycodeigniter/system/application/controllers/mycontroller/mymethod 2>&1 >> /var/log/my_log.log

whatever, i haven't got log file and cronjob can't work.

#6
[eluser]weboap[/eluser]
http://ellislab.com/codeigniter/user-gui...l/cli.html


http://codeigniter.com/wiki/Category:Adv...CronScript



Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.