Support

Akeeba Backup for Joomla!

#8416 CRON Backup of DB Only not working with FTP Layer enabled

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, 27 April 2010 23:10 CDT

user9517
I'm trying to implement daily backups of the DB using a native CRON Job. I've created a configuration for it - and this configuration works fine if invoked manually. When invoking it using a shell script however i get this output

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

Domain :
Step :
Substep :

Domain : init
Step :
Substep :

PHP Fatal error: Class 'JLoader' not found in /var/www/vhosts/t/httpdocs/libraries/joomla/client/ftp.php on line 164

A full site backup works fine using the shell script. There is no post processing specified - so the file is not uploaded somewhere. Experimenting a bit i noticed that it works fine with FTP Layer disabled. The problem appears both in alpha 5 and beta 1. There seems to be the completed sql file in the temporary folder but there is nothing in the output folder. Not even an akeeba.log file is created.

Is this a bug with Akeeba or a problem with my vhost configuration.

Thx in advance, Markus

dlb
This one is a question for Nicholas. I'll flag it for his attention.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

nicholas
Akeeba Staff
Manager
Please download and use developer's release 122, available from http://www.akeebabackup.com/developer-releases/02-akeebapro.html The issue should be fixed there.

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!

user9517
Sadly i can't install developer release 122 - i get the error
* JInstaller::install: File '/var/www/vhosts/aestomed.at/httpdocs/tmp/install_4bd1d80eea45d/backend/plugins' does not exist.

user9517
I realised that all the files where in the installation package, but the folder structure was wrong (some files - especially the plugins - located in a Projects folder). After fixing this manually i was able to install the component. But the DB only backup with FTP Layer enabled still does not work - the output is now

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

Domain :
Step :
Substep :

Domain : init
Step :
Substep :

PHP Fatal error: Class 'JError' not found in /var/www/vhosts/aestomed.at/httpdocs/libraries/joomla/client/ftp.php on line 508

As before - backup with FTP Layer disabled is still working as is the full backup (both with ftp layer enabled and disabled)!

nicholas
Akeeba Staff
Manager
Both these issues should be fixed in SVN123. Do note that the fatal error you were getting was probably due to a problem in the FTP settings.

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!

user9517
The installer was fixed, the JError issue only partly. The class JError is now found but then there is a PHP error in libraries/joomla/error/error.php - line 480. The global $mainframe isn't defined.

But that's just details ... the FTP Error was that the cron job is executed by a different user - therefore creating a file in the tmp folder that is not writeable by the FTP User - and the execution then fails when the file is renamed. I guess it's easy enought to fix by running the job with the ftp user. What I'm wondering - why does the full backup work then? Does it use different file operations?

user9517
I figured out the problem - my configuration is so that the backups are created in a folder that is below the path of the ftp user (backups are in var/www/backups and the ftp user only has access in /var/www/vhosts/domainname/httpdocs). Akeeba tries to use the function move in class AEPlatform to copy the files from the temporary folder to the final folder. The first choice there is to use JFile, followed by @rename, followed by JFile:copy, ...
JFile failes because the ftp layer can not handle the path, @rename would work however it is never executed due to the php error ($global mainframe is not defined) that halts the execution of the script.

A fix for the $mainframe issue should get the backup finally working (other than me hacking the code that is) - however I don't know if this is even possible since. Another solution would be to add a configuration parameter whether to try to using the JFile class for moving files or not - or simply use Exception handling for the JFile commands.

nicholas
Akeeba Staff
Manager
Defining the $mainframe is impossible, because it requires instanciating a full-blown Joomla! application. This is an overkill and should only be necessary if you use the FTP layer and your server is lacking the native ftp_* commands and your FTP user has access only to directories above the site's root. This is an extremely rare setup, which doesn't justify the whole coding ordeal to instanciate a full Joomla! application in the CLI mode.

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!

user9517
I thought creating the mainframe might not be feasible. :( I'm now using a hacked version with the JFile operations removed and i'm happy with that - just have to remember to always do this with future updates. Combination of FTP Layer (which we use for all sites) and no access for FTP user to the path is enought - native ftp_ commands don't play i role I think.

As for rare setup - It's standard Ubuntu Servers with Plesk as a control panel (various versions of both plesk and ubuntu - and apache and php as well). Can't get more common i think. I guess the problem is me insisting to get the files to someplace outside the regular paths (a mounted hd from another server) - but a backup that can be accessed (and deleted) by everbody with the ftp pass is not really a secure backup to me.

nicholas
Akeeba Staff
Manager
The server setup is common and is pretty much what I am using for local development (sans the Plesk panel). However, the native FTP commands are present on my system, I double checked. When I said "rare setup" I was referring to having the native FTP commands disabled.

Regarding your concerns, you might try two things:
1. You can use the post-processing FTP option to move your backup archives to a remote FTP path. If you are concerned that someone could delete the files, you can set up this directory to rsync to another path and then remove the original files.
2. You can always send your backups to the cloud. S3 supports creating write-only users who can only upload files, but not read or download them. IMHO, this is a much better approach as it tackles the security issues effectively.

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!