Page 1 of 1

Need help with Owncloud background job and Cron

Posted: 27 Apr 2014 05:51
by stephane
Hello

I have been banging my head trying to get the Owncloud (6.0.2) background job to be executed by cron instead of Ajax (Owncloud default value); but I have been unsuccessful in making this work.

In the CRON interface, I get a "Failed to execute" message when I click run now. This is what I get when I try the command in Putty:

nas: data # php-cgi /mnt/data/owncloud/cron.php
X-Powered-By: PHP/5.5.8
Content-type: text/html
Notice: Undefined index: SCRIPT_FILENAME in /mnt/data/owncloud/lib/base.php on line 103
Notice: Undefined index: SCRIPT_NAME in /mnt/data/owncloud/lib/private/request.php on line 122

The script runs fine when called by a browser. My understanding is that the variables are not set when the cron.php is not called by a browser, as it is the case with cron. So any idea how i can correct this? I can obviously leave the default as is, but this is not the recommended way...

Thank you for your help

Re: Need help with Owncloud background job and Cron

Posted: 01 May 2014 17:24
by nonparity
I am having the same issue.

To add a bit to this however if I run the cronjob manually from within terminal (php -f /home/cloud/public_html/cron.php) it works fine but running it via a cronjob gives the errors below

[01-May-2014 12:00:01 UTC] PHP Notice: Undefined index: SCRIPT_FILENAME in /home/cloud/public_html/lib/base.php on line 103
[01-May-2014 12:00:01 UTC] PHP Notice: Undefined index: SCRIPT_NAME in /home/cloud/public_html/lib/private/request.php on line 166

Re: Need help with Owncloud background job and Cron

Posted: 08 Aug 2014 13:26
by miGi
Hello. I got it working using owncloud 7.0.1 webcron and wget.

Just make new cronjob to call:
/usr/local/bin/wget --no-check-certificate -qO /dev/null "https://--ip/localhost--/owncloud/cron.php"

If you dont use ssl --no-check-certificate, won't be necessary