LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-05-2015, 10:20 AM   #16
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947

Quote:
Originally Posted by cgaie View Post
sorry it is var not etc

*/15 * * * * php /var/www/owncloud/occ files:scan --all

This is the output

carlos@ubuntu:~$ env -i bash
carlos@ubuntu:/home/carlos$ export PATH=/usr/bin:/bin php /var/www/owncloud/oc>
bash: export: `/var/www/owncloud/occ': not a valid identifier
bash: export: `files:scan': not a valid identifier
bash: export: `--all': not a valid identifier
carlos@ubuntu:/home/carlos$
Why did you run the php command on the same line as the export? It was not in the example, and export is clearly complaining about it. The php command needs to be its own command on its own line like in the example.

Last edited by suicidaleggroll; 04-05-2015 at 11:07 AM.
 
Old 04-05-2015, 07:09 PM   #17
cgaie
LQ Newbie
 
Registered: Apr 2015
Posts: 9

Rep: Reputation: Disabled
Sorry, because I got this before and I thought I was doing it wrong

carlos@ubuntu:~$ env -i bash
carlos@ubuntu:/home/carlos$ export PATH=/usr/bin:/bin
carlos@ubuntu:/home/carlos$ php /etc/www/owncloud/occ files:scan --all
Could not open input file: /etc/www/owncloud/occ
carlos@ubuntu:/home/carlos$
 
Old 04-05-2015, 07:11 PM   #18
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
I thought you said it was /var/www/owncloud...?
 
Old 04-06-2015, 06:16 AM   #19
cgaie
LQ Newbie
 
Registered: Apr 2015
Posts: 9

Rep: Reputation: Disabled
Yes it is var. My mistake. Here is the output

exception has been thrown


carlos@ubuntu:~$ env -i bash
carlos@ubuntu:/home/carlos$ export PATH=/usr/bin:/bin
carlos@ubuntu:/home/carlos$ php /var/www/owncloud/occ files:scan --all
PHP Warning: flock() expects parameter 1 to be resource, boolean given in /var/www/owncloud/lib/private/config.php on line 178
An unhandled exception has been thrown:
exception 'Exception' with message 'Could not acquire a shared lock on the config file /var/www/owncloud/config/config.php' in /var/www/owncloud/lib/private/config.php:179
Stack trace:
#0 /var/www/owncloud/lib/private/config.php(38): OC\Config->readData()
#1 /var/www/owncloud/lib/base.php(100): OC\Config->__construct('/var/www/ownclo...')
#2 /var/www/owncloud/lib/base.php(473): OC::initPaths()
#3 /var/www/owncloud/lib/base.php(1011): OC::init()
#4 /var/www/owncloud/console.php(12): require_once('/var/www/ownclo...')
#5 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#6 {main}carlos@ubuntu:/home/carlos$
 
Old 04-06-2015, 10:41 AM   #20
cgaie
LQ Newbie
 
Registered: Apr 2015
Posts: 9

Rep: Reputation: Disabled
I managed to run the cron from the terminal as user "www-data" and it runs without problem

sudo -u www-data php /var/www/owncloud/occ files:scan --all

All sorted now

Thanks

Last edited by cgaie; 04-06-2015 at 11:01 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to manually add SATA driver manually when kernel boot? aixilin Linux - Kernel 6 08-15-2008 11:36 AM
service start httpd fails, manually starting with same command works jonboede Linux - General 1 02-19-2008 12:45 PM
Cups, not having to manually start printers jweber0126 Linux - Newbie 2 01-18-2007 03:29 AM
How to manually start apache web server (SUSE9.2) Mic Q SUSE / openSUSE 4 07-10-2005 10:08 PM
How to start IPOP3D manually, not from XINETD adamrau Linux - Software 3 07-07-2003 03:16 PM


All times are GMT -5. The time now is 12:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration