Support

Akeeba Backup for Joomla!

#37198 Akeeba CLI Backup not completing: exits with return code 24

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
3.10.9
PHP version
7.4
Akeeba Backup version
8.1.4

Latest post by tampe125 on Wednesday, 01 June 2022 02:04 CDT

[email protected]

The site is sort of large. Backup does work from the backend, and my successful backup has a size of 1.60 GB.

The scheduled task sends an email with a log of the output, and it ends like this:

. . .

Last Tick   : 2022-05-27 19:20:20 GMT+0000 (UTC)
Progress    : 74 %
Domain      : Packing
Step        : /home/public/media/k2/items/cache
Substep     :
Memory used : 10.85 MB
Warnings    : no warnings issued (good)

Last Tick   : 2022-05-27 19:20:25 GMT+0000 (UTC)
Progress    : 74 %
Domain      : Packing
Step        : /home/public/media/k2/items/src
Substep     :
Memory used : 9.6 MB
Warnings    : no warnings issued (good)
/usr/local/bin/php /home/public/cli/akeeba-backup.php exited with return
code 24

Here's a link to the log file generated by Akeeba: https://drive.google.com/drive/folders/1AGYLGkdqXDkoSqQRAdLQg4W4ANyUNhzo?usp=sharing

Let me know if you need anything else from me!

Some things I have tried:

  • Set Maximum execution time to 10 seconds, from 30.
  • Set Execution time bias to 50%, from whatever the it was set to (75% I think?).

Other misc. details:

  • The command I used is: /usr/local/bin/php /home/public/cli/akeeba-backup.php
  • The backup is marked as 'Pending' for a while after the command ended, like maybe half-an-hour?

tampe125
Akeeba Staff

Hello,

looking at the backup log, the process gets interrupted after 3 minutes and 10 seconds. I suspect your host is enforcing a timeout for CLI operations, killing the process when it's taking too long.

You can ask for an increase of the timeout, but before doing that, I'd suggest to exclude useless data from the backup. For example, I'd start excluding the folder media/k2/items/cache/ . This is just a cache folder for K2 component that holds thousands of images. Even if you delete that, it's not a big deal, since K2 will recreate them on demand.

Please exclude that folder and try again, it should speed up your backup and you should stay within the time limit.

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!

[email protected]

Thanks for the guidance! Excluding the K2 cache brought the backup down from 1.6GB to 1GB, and I was able to successfully make a backup with a manual ssh connection when I couldn't before.

The cron task is still timing out, but I'll see what I can do. Worst case I can make backups by connecting remotely over ssh. Thanks for your help, you can close this!

tampe125
Akeeba Staff

You're welcome!

By the way, regarding the timeout under CLI, it fails because your host is imposing a maximum CPU usage time limit. Please note that CPU usage is different than wall clock time, hence the small variability of a few seconds you may observe in different backups' log files from the start of the backup until the point it abruptly stops.

You will need to contact your host and let them know they have to make a configuration change in their server to let you run your backups. You may use the following text, replacing XYZ with the time it takes to run a backup from the backend plus about 10%. You can find out the time it takes to run a backup in the backend of your site, Akeeba Backup, Manage Backups. If you have multiple backup profiles use the time from the longest-running profile.

Here is the text to use:

I am using CRON jobs to take a backup of my site. I have observed that my CRON job stops executing at around REPLACE THIS BASED ON WHAT YOU SEE IN THE LOG FILE seconds. This is not enough time to complete a backup of my site. This means that you have set up a CPU usage limit either with ulimit or the /etc/security/limits.conf file on your server.

Please make the current CPU limit for my user into a soft lift and set up my CRON jobs so they have a CPU limit of XYZ. This would allow my backups to run without affecting the sensible time limits you have set up for PHP script running over the web.

If your host refuses to make changes you can still automate your backups, either using a third party over-the-web CRON job service which respects redirections (e.g. WebCRON.org) or a third party service which is compatible with Akeeba Backup such as myJoomla.com, BackupMonkey.io or Watchful.li. The latter kind of services also offer additional features such as security auditing, site monitoring, management of core Joomla and extension updates across multiple sites, even backup testing automation in some cases.

The downside of third party services is that they cost money. You can alternatively have an always on-line computer (even a cheap Raspberry Pi would do!) run backups remotely using CRON jobs, either using the Legacy Frontend Backup URL or the modern Akeeba Backup JSON API. In the latter case you'd need to set up Akeeba Remote CLI on the always on-line computer. The always on-line computer can run any of the three major Operating Systems: Windows, macOS or Linux. 

 

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

Easter vacation: We will be closed from 17 April 2025 16:00 UTC to 21 April 2025 06:00 UTC due to observing the Christian Easter holiday. Support will be closed during that time for both new tickets, and replies to existing tickets.

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!