Support

Akeeba Backup for Joomla!

#9223 Cannot get Native Cron to work

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 December 2011 17:42 CST

user50505
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? yes
Have I searched the forum before posting? yes
Have I read the documentation before posting (which pages?)? yes all
Joomla! version: 1.7.3
PHP version: 5.3.8
MySQL version: 5.1
Host: (optional, but it helps us help you)
Akeeba Backup version: Professional 3.3.10

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 can't seem to get the automated backups to work. I have setup the cron job. The command I am running is /usr/bin/php5-cli /home/[accountname]/public_html/administrator/components/com_akeeba/backup.php

I double checked the location of the php5-cli which is correct and I receive the following email after the cron runs but there is no backup archive to be found and nothing shows under the 'Administer Backup Files' from the Akeeba Component in Joomla.

Akeeba Backup CLI 3.3.10 (2011-12-04)
Copyright (C) 2010-2011 Nicholas K. Dionysopoulos
-------------------------------------------------------------------------------
Akeeba Backup is Free Software, distributed under the terms of the GNU General
Public License version 3 or, at your option, any later version.
This program comes with ABSOLUTELY NO WARRANTY as per sections 15 & 16 of the
license. See http://www.gnu.org/licenses/gpl-3.0.html for details.
-------------------------------------------------------------------------------

Starting a new backup with the following parameters:
Profile ID 1
Description "Command-line backup"

Current memory usage: 390.76 Kb

Unsetting time limit restrictions.

Site paths determined by this script:
JPATH_BASE : /home/[accountname]/public_html/administrator
JPATH_COMPONENT_ADMINISTRATOR : /home/[accountname]/public_html/administrator/components/com_akeeba

If I run Akeeba manually backups work perfect. I had this working once before on a different server, I just can't figure out what's missing.

Regards,

Jaron

nicholas
Akeeba Staff
Manager
Hello Jaron,

The backup log file is irrelevant because at that point the backup engine has not loaded yet. Let's try something different. Open the backup.php file with a plain text editor (e.g. Notepad, NotePad++, gEdit, Kate, Vim, Fraise or TextWrangler – depending on your Operating System). Find line 16. It reads
$exitCode = 0;
Change it so that it reads:
$exitCode = 0;
define('AKEEBADEBUG',1);
error_reporting(E_ALL);
ini_set('display_errors',1);


Save the file and run the CRON job again. It will fail again, but this time it should print out debug information after the "Site paths determined by this script" which you can copy and paste here for me to see and understand what went 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!

user50505
Thankyou Nicholas,

I have done as requested and here are the results. FYI - I have moved my Configuration.php file outside of my root for added security and changed both adminstrator/includes/defines.php and incudes/defines.php to recognise this. I take it backing up via cron does not recognise this change?

Regards,

Warning: require_once(/home/bbpro/public_html/configuration.php): failed to open stream: No such file or directory in /home/bbpro/public_html/administrator/components/com_akeeba/akeeba/utils/jconfig.php on line 28

Fatal error: require_once(): Failed opening required '/home/bbpro/public_html/configuration.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bbpro/public_html/administrator/components/com_akeeba/akeeba/utils/jconfig.php on line 28

nicholas
Akeeba Staff
Manager
OK, that explains it. The backup.php and altbackup.php scripts will NOT work with this kind of setup as they do not read the modifed defines.php file. This will be possible after April, when I will completely drop support for Joomla! 1.5 which means that I will finally be able to provide a REAL command-line script, based on the JCli class instead of the hack-ish method I had to invent two years ago.

OK, that said, moving the configuration.php does not make your site any more secure. First, let's consider that nobody can access the configuration.php file over the web. This leaves us with two possibilities:
- Joomla! extension exploit. In this case, the attacker is able to inject code which is executed by Joomla!. Tip: if you do $x = new JConfig; var_dump($x); die(); you get all configuration values no matter where the file is stored.
- A script on your account or a compromised account peeking at your configuration file. He he. It's so darn trivial to overcome. Look for the defines.php file in two locations and include the proper one. Then load the configuration.php file from the JPATH_CONFIGURATION path and do the aforementioned var_dump script.

Rule of thumb: if it can't be read, moving it around won't help. So just do yourself a favour and leave the configuration.php file where it is. Moving it around makes it difficult for legitimate scripts to operate (not to mention it renders Global Configuration useless) and does not put the slightest hurdle in the way of a hacker. The only way it might prevent some hacks yet is that script kiddies don't have the workarounds I mentioned in their hands. Yet. Do you want to bet what will be the status quo in 6-12 months?

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!