Support

Akeeba Backup for Joomla!

#24330 Plugin event triggered if a backup is finished

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 on Thursday, 03 March 2016 17:20 CST

rdeutz
Description of my issue:

Any chance to hook into the backup process? As far as I see it in code there is a plugin event triggered "OnBeforeAkeebaControllerBackupAjax" but using this one might end in a disaster depending on the host I am doing it. I know also that there is a possiblity to send an email/push message after a backup is finished.
What would be great is to have something like "OnAfterBackupFinished". That would allow to do messaging and sending information about a finished backup to whatever endpoint.

Cheers,
Robert

nicholas
Akeeba Staff
Manager
The problem is that any plugin would be called from the context of an AJAX request. I can see the following problems:
  • If the plugin fails for any reason or causes a timeout the backup reports an AJAX error and people will come to us for support. It will be impossible for us to convince our clients that no, we are not stupid, it's a third party plugin doing something bad.
  • We are moving away from a platform-specific implementation for our backup software and into a common code base for all backup products. Having a plugin event for Joomla! would be inconsistent at best and most likely problematic for other platforms.
  • The proper way to get notifications for complete backups is by using Finalization classes. There is currently no way to register arbitrary Finalization classes.


If anything, I'd like to let you do the latter. Your users would have to explicitly enable the third party Finalization classes. In this case I'd print a BIG FAT WARNING™ that third party Finalization classes are loaded and no support will be provided unless you can reproduce an issue without them loaded. Does that sound better?

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!

rdeutz
Yeah, I agree this has a lot of potential to be a nightmare for your support. What I was thinking (a bit) about was to make the last request as a "normal" (joomla) task (or a redirect) and then use the usual before/after plugin integrations. This means to change the way you are doing the backup and for sure I am not asking you to do it (I chose not to be killed by you the next time we meet)

I am fine to close this ticket.

Thanks Nic.

nicholas
Akeeba Staff
Manager
You can always issue a redirect at the end of the backup. Just send the user to index.php?option=com_akeeba&view=backup&autostart=1&returnurl=BASE64_ENCODED_RETURN_URL&profileid=PROFILE_ID&token=JFORM_TOKEN where:
BASE64_ENCODED_RETURN_URL = base64_encode($url);
PROFILE_ID = (int) $profile_id;
JFORM_TOKEN = JFactory::getSession()->getToken();

This auto-starts a new backup with profile number PROFILE_ID. At the end of a (successful) backup it redirects you to $url. The URL should be internal or JApplication in the latest Joomla! versions will ignore you ;)

Regarding allowing you to hook up to the end of the backup process I just realised it would be impossible. You assumed all along that the only valid backup method is the back-end backup, i.e. a Super User or a back-end user with the akeeba.backup ACL privilege is logged in to the administrator back-end of the site. Plugins and finalization classes would also be triggered in the case of front-end backup, JSON API backup and CLI backup (since we go through JApplicationCli). Therefore allowing you to trigger plugin events / custom classes would definitely break our software. For this reason I decided to not implement any such feature. You'll have to use the special backup URL I posted above. You can see that special URL in action in the system/backuponupdate plugin ;)

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!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

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!