#40237 Akeeba BAckup for joomla 3 exit code

Posted in ‘Akeeba Backup for Joomla! 3’
This is a public ticket

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

Latest post by nicholas on Tuesday, 06 February 2024 07:41 CST

GroupeTecnic

Hi

 

Is there a way to get around the "more than 120days version" exit code =1 on that older version of akeeba backup.

We know that it's old joomla, so we're stuck with that older version of Akeeba backup and it keeps throwing this exit code= 1 (failed) even if it's successful.

 

Thanks

Math

nicholas
Akeeba Staff
Manager

The last published version for Joomla! 3, Akeeba Backup 8.3.3, does not have that message. Which version of Akeeba Backup, Joomla, and PHP are you using?

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!

GroupeTecnic

 

 

Akeeba Backup Professional 8.3.3 (2023-08-07)

Joomla! 3.10.12 Stable 

PHP version 7.4.33

 

Not certain if that make any difference, but we're actually running the backup job with a cron job in an openshift environement.

 

Thanks

 

nicholas
Akeeba Staff
Manager

Originally, I thought that you would see a message something something something 120 days which would immediately fail your backup. This did exist in some previous 8.x versions for the JSON API, but it was disabled in 8.3 knowing this is the last version branch for Joomla! 3. Hence my previous reply.

Now I get what you mean. You are seeing a backup warning, and the exit status of the CLI backup script is 1. Okay, this is normal and yes, we can change that by editing a file indeed.

There is indeed a warning issued reading “Your version of Akeeba Backup is more than 120 days old and most likely already out of date. Please check if a newer version is published and install it”. When you are using the command-line backup tool akeeba-backup.php the exit code is 1 when there are warnings in the backup. I assume you base your automation on the exit code being a clean 0 on a successful backup, therefore it makes sense to want to remove this warning. Yes, we can do that.

Edit the file administrator/components/com_akeeba/BackupPlatform/Joomla3x/Platform.php and find this block of code in lines 735-751:

		// If the release is older than 3 months, issue a warning
if (defined('AKEEBA_DATE'))
{
$releaseDate = new Date(AKEEBA_DATE);

if (time() - $releaseDate->toUnix() > 10368000)
{
if (!isset($ret['warnings']))
{
$ret['warnings'] = [];
$ret['warnings'] = array_merge($ret['warnings'], [
'Your version of Akeeba Backup is more than 120 days old and most likely already out of date. Please check if a newer version is published and install it.',
]);
}
}

}

Change the second line reading if (defined('AKEEBA_DATE')) to now read:

if (false)

Save the file. Now the code which was adding the backup warning is removed.

I would also like to ask you for your permission to set this ticket to public.

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!

GroupeTecnic

Yes, You can set to public.  

 

Will test this evening and see result tomorrow morning.

Thanks

 

nicholas
Akeeba Staff
Manager

Thank you, I made this public. Let me know how it goes :)

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!