Support

Akeeba Backup for Joomla!

#40017 How to operate “Akeeba Backup – CLI-only Backup”?

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
5.0.x
PHP version
8.2.11
Akeeba Backup version
9.8.3

Latest post by nicholas on Thursday, 21 December 2023 07:41 CST

HDcms

hello

I read the doc covering the 2 tasks on the page https://www.akeeba.com/documentation/akeeba-backup-joomla/automating-your-backup.html

I managed to get backups working well with a cron on the server.
For some cases I want to use akeeba scheduled task
The 1st "Akeeba Backup – Take a Backup​" works but a bit slow and fails (as mentioned).

I scheduled the other "Akeeba Backup – CLI-only Backup​" every minute today, but it does not launch.
I read it right :

"Take a backup of your site with Akeeba Backup. This task type works only when scheduled tasks are triggered by a CLI CRON job."

but I haven't seen an example or understood concretely where else I should implement this. How to do ?
(If it is the host's cron, I don't see the point since I already know how to do it like that)

Regards

nicholas
Akeeba Staff
Manager

Please read the entirety of this documentation section https://www.akeeba.com/documentation/akeeba-backup-joomla/automating-your-backup.html#joomla-scheduled-tasks.

Please make sure to read carefully the “The two Akeeba Backup task types” section to understand the difference between the two task types, and “Setting up your site for scheduling using a CLI CRON job” to understand how to set up Joomla's Scheduled Tasks to run using a CLI CRON job, which is a prerequisite for using the "Akeeba Backup – CLI-only Backup​" task type.

(If it is the host's cron, I don't see the point since I already know how to do it like that)

Yes, it is the host's CRON. You are wrong that there is no point, though :)

When using Scheduled Tasks you need exactly one (1) CRON job on your host, regardless of the number of scheduled tasks you set up in Joomla!.

Moreover, Scheduled Tasks can be managed inside Joomla, without having to use your host's CRON interface. Every Scheduled Task can be assigned an access level and edit permissions. Therefore, you can allow someone who is NOT a Super User to manage the backup task, if the use case calls for it.

Either or both of these two points can be very important in some use cases. For people like you and me the appeal is probably non-existent, but we're not exactly typical users, are we? ;)

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!

HDcms

hello

I had read (and reread) this complete document but I wanted to be sure I understood it correctly. I asked the question on the Joomla France forum and a large participant had the same questions.

I therefore abandon the "Akeeba Backup – CLI-only Backup" solution, because for "small sites <300 MB, with little modification, I would like to be independent of the host (or other service provider) and make a backup between 1 hour and 4 a.m....

So I started again with the 1st task. the test works but I was not able to get it to work last night at 3am (see image).
What other mistake did I make?

Regards

nicholas
Akeeba Staff
Manager

The way Scheduled Tasks work, this will run for the first time in January.

You told Joomla! to run the task once a month, on the 20th day of the month, at 03:54 UTC. Since you created this definition on December 20th, after 04:54 Paris time (03:54 UTC), the next execution time is the 20th of the next month, i.e. January 20th at 03:54 UTC.

Further to that, setting up a Scheduled Task is not enough. You have to set up a runner for the scheduled tasks. As I have documented – what Joomla! should have documented, mind you! – there are three options: lazy scheduling (unreliable), web CRON, and CLI CRON. None is enabled by default. Which one did you enable, and how did you set it up?

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!

HDcms

Hi

I had scheduled the backup for 12/19 for the next day.
BUT I think I finally understand. This is the first time I've used a planned stain. Despite all the time spent reading the documents on this, I forgot to activate the cron!! (I understand that there are not enough volunteers to update the Joomla documentation, I don't blame anyone).

See my settings which may not be optimal for making weekly backups between 1 a.m. and 4 a.m. for small sites <300MB.

Can you tell me how to optimize this setting? because the backup of this small site is still pending for 30 minutes while I visited it.

Regards

 

nicholas
Akeeba Staff
Manager

All the ways I can explain this are already in our documentation which I wrote myself. You are asking me to repeat myself which would either be me copying and pasting stuff from it, or saying the same things in the same way (because there's only so many ways I can explain something), neither of which would help you.

Scheduled Tasks are train tickets to go from place A to B on date and time X. If there is no train, the ticket is useless. There are three trains. The slow-ass steam engine which runs whenever someone bothers to (lazy scheduling), the run-down diesel locomotive which is great for short distances but may break down for long travel (web CRON), and the electric bullet train (CLI CRON). The passengers will get on any of the trains, whichever comes first, except the snooty passenger who only travels by bullet train (these are the "CLI Only" scheduled task types). Most tickets are for direct travel (single request), some tickets have layovers (multiple requests, like the backup task). Most tickets are season passes (repeatable tasks on a schedule), some tickets are one-way only (run once tasks). I am the station master. I have to give the right ticket to the right passenger, and make sure there are trains scheduled to come pick them up.

Try to find someone else to help you set up Scheduled Tasks. Maybe the can explain it a bit differently, in a way that "clicks" with you. I would recommend starting with something simple, like one of the sample tasks included with Joomla. The goal is not to do useful work, but to understand how it works. Something runs periodically in some way or another, goes through the scheduled tasks you have set up, and executes them based on a set of criteria. Unfortunately, I can only tell you that, not understand it for you :)

Once you get your head around how Scheduled Tasks work, their operating principle, then it's time to go to a more complex and long running task like taking backups.

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!

HDcms

Hi
Thank you for the very telling image, more than the documentation which I have actually read several times :-)
I have already done the demo task - Standby: Ok
I have already asked on the forum in French - no response yet for operation.
I'll ask again elsewhere.

When I have successfully backed up, can you just tell me which setting would optimize the backup time for a site <300MB at night between 1am and 4am with the method "Akeeba Backup – Take a Backup"

Regards

".

nicholas
Akeeba Staff
Manager

It's not a setting which would improve the time, that's what I am trying to tell you.

In my train example, it's not about buying a train ticket to first class; the first class of the train reaches the destination at the same time as the second class. You need to get on a faster train.

In other words, changing the configuration of the Scheduled Task won't make it faster. It's about using a different scheduled task runner which runs tasks faster.

You are currently using the Lazy Scheduling. This is deathly slow for two reasons:

  • It is only triggered when you have people visiting your site. No visitors, no scheduled tasks are running.
  • Since it runs on the web, the backup has to be split it in really small chunks of work. This means more chunks of work. Therefore you need many more visits to trigger each of those chunks. As a result, it takes a lot of time.

Understanding that, you understand that to solve the problem you need a task runner which does two things:

  • Runs frequently and consistently, regardless of whether your site has visitors currently visiting it.
  • It must NOT run on the web. It must run under the CLI, where time and memory limits are more lax. Therefore we can spend more time in each chunk of work. As a result we need less chunks of work. This means that the total amount of wall clock time elapsed during the backup will be smaller.

This can only be done by using the CLI CRON job to trigger Scheduled Tasks every minute as explained in https://www.akeeba.com/documentation/akeeba-backup-joomla/automating-your-backup.html#joomla-tasks-cli.

Easy, or fast: pick one.

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!