Support

Akeeba Backup for Joomla!

#11501 Cron job

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by nicholas on Tuesday, 13 March 2012 10:35 CDT

erkan
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? yes
Have I searched the tickets before posting? yes
Have I read the documentation before posting (which pages?)? yes
Joomla! version: 2.5.2
PHP version: 5.3.3
MySQL version: 5.1.49-3
Host: Own VPS server, Debian 6
Akeeba Backup version: 3.4.2

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 2Mb, please upload it on your server and post a link to it.

Description of my issue:

I was going to set up backup with Akeeba using cron jobs. I added this command line to my cron job file:

20 * * * * usr/local/bin/php /var/www/vhosts/ffatest.se/ffatest.se/httpdocs/administrator/components/com_akeeba/backup.php

But it doesn´t work and I can´t figure out why.

nicholas
Akeeba Staff
Manager
If by "doesn't work" you mean "it never executes" this is a question you have to ask your host as we can't know your server setup and we can't possibly offer support for any hosting service out there.

If by "doesn't work" you mean "it starts but there is an error message" start by telling us what the error message is and attaching your command-line backup log file so that we can take a look and figure out what is going on.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

erkan
I have my own VPS server with Debian 6 so there is no hosting company to ask.

I think it doesn´t execute.

Is it possble to use an URL instead to the backup.php file?

Becuase I have other cron jobs using URL:s with wget command and they work fine.

nicholas
Akeeba Staff
Manager
OK, since it's a VPS you can actually test and fine tune your CRON job. I will tell you what I'd do on my server over SSH.

First, run a
which php
to see the absolute path to the PHP executable. Let's say it replies /usr/bin/php. Now run
/usr/bin/php -v
It should reply something like
PHP 5.3.8 with Suhosin-Patch (cli) (built: Nov 15 2011 15:33:15) 
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

The important part is the "(cli)" thing in the first line. If it reads "(cgi)" or "(fcgi)", it's not the binary you want and you probably have to install the php5-cli package. In short, the first part of your command line should point to the PHP CLI binary.

Now check the second part of your command line, which is the absolute path to the file. I can see that you have "ffatest.se" twice in there. I think this isn't correct. Double check the path.

Then, try running the command (without the stars and numbers in front of it, of course!) directly from the SSH command line. Does it run? Do you get an error?

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

erkan
I got this reply:

PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP 5.3.3-7+squeeze5 with Suhosin-Patch (cli) (built: Jan 23 2012 12:38:42)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

And yes I should have ffatest.se two times. For example when I set folder permissions I run this command and it works every time:

chown -R www-data:www-data /var/www/vhosts/ffatest.se/ffatest.se/httpdocs

As you can see there I have ffatest.se two times.

nicholas
Akeeba Staff
Manager
I think that with that very last comment you answered your own question. All of your site's files and directories are owned by Apache's user and group, www-data. The CRON job, on the other hand, executes as your local user. Therefore, the filesystem permissions should not allow you to access the backup.php file and, even if you can access it, it may not be able to find the rest of the files it needs or write to the backup output directory. Therefore I think that you have a permissions issue.

FWIW, your version of PHP is supported by yours truly and it's one of the versions I have tested my software with (albeit on an Ubuntu Server machine, which should be the same as Ubuntu is essentially a Debian distro with some additional bells and whistles).

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

erkan
Is there something I can do about it?

nicholas
Akeeba Staff
Manager
It's pretty much impossible to say. It depends on whether it's a dedicated server for a single domain or a server hosting multiple domains.

In the former case, create a new user and have Apache run as that user. Then create the CRON jobs to run under the same user. No need to worry about permissions again.

In the latter case, the best approach is to install suPHP and create one user account per site.

As it is right now, you can't do anything, unless trying to have your CRON job run as www-data.

Please note that providing server setup instructions or instructions on how to use your server software is outside the scope of this ticket system. These generic instructions are as far as I can go.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!