Support

Akeeba Backup for Joomla!

#21182 start Akeeba backup programmatically

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 tampe125 on Wednesday, 08 October 2014 03:54 CDT

bertmeelberg
Hi,

Is it posible to start a (database) programatically from within one of my custom componenents?

I tried exec, but of course that does not work.

Any hits are apriciated.

Gr Bert

tampe125
Akeeba Staff
Hello Bert,

can you please be a little more specific?
What do you want do? What did you tried?

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

bertmeelberg
Hi this is for Joomla Akeeba Backup Pro, which I have a subscription for too.

When a customer registers for our workshop (this is done with a component I devellopped) I want to make a backup (only database)

I tried this:

$path = getcwd();
$cmd = $path .'/cli/akeeba-backup.php';
exec($cmd . " > /dev/null &");

But that does not work.

Hope you can help

tampe125
Akeeba Staff
I'm sorry but that's not technically possible, for a full explanation please take a look at this and this page in the documentation.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

bertmeelberg
Ofcourse it is possible. See in the same article:

"It's exrtemely easy for me to create a plugin which waits for an article to be saved ...."

My event happens maybe one or two times a day.

tampe125
Akeeba Staff
Quoting from the first page I linked:
A full site backup is something which takes a heck of a lot of time, CPU and RAM to perform. It can't happen in a single page load. That's why you need Akeeba Backup, because it splits the process into smaller steps suitable for execution on the server. Asking for an automatic backup without CRON means that the backup would have to be taken as a visitor tries to load a page on your site. That would lead to a blank page, or -in the best, unrealistic, case scenario- your visitor would have to wait for several minutes or hours before the page loads. Come on, get real. There is a reason why there are CRON jobs. Long running operations, like backups, are one of them.



Before you argue that it is possible, please read our documentation regarding the known issues of the Lazy Scheduling plugin. That plugin was designed to solve that problem. Guess what? It turns out that the limitations on the servers where you can't use CRON are so big that even this solution can't work reliably. If you can't get a CRON job working on your server, try webcron.org. It rocks.

This limitations will apply even if you are trying to backup the database only.
If you only have to backup a single table, it would be more efficient to implement your own script, where you get all the data and dump it into a backup file.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

bertmeelberg
I see.
You are correct.

thanks for the hint to backup only the table of interest into a file.

Grtz Bert

tampe125
Akeeba Staff
You're welcome!

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
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!