Support

Akeeba Backup for Joomla!

#40073 Wrong backup file name when the backup is initiated by a Cron

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.01
PHP version
8.2.13
Akeeba Backup version
9.8.3

Latest post by stavrosz on Tuesday, 02 January 2024 03:26 CST

stavrosz

I configured the names of the backup files to be "site-[HOST]-[DATE]-[VERSION]-[RANDOM] "

As a result when I click the button to do a backup I get something like 

On my localhost server (named "sites") I get "site-sites-20240102-9.8.3-9UlCscuM3WBDLEjs.jpa ", which is correct.

On my online server's website with a domain name (e.g. "example.com") I get "site-www.example.com-20240102-9.8.3-9UlCscuM3WBDLEjs.jpa " which is correct.

 

The problem is that when the backup on the online server was initiated by a cron job, the resulting file appears with a wrong name like "site-sites-20240102-9.8.3-9UlCscuM3WBDLEjs.jpa " instead of the expected name "site-www.example.com-20240102-9.8.3-9UlCscuM3WBDLEjs.jpa "

Where does Akeeba Backup find the name "sites" on my online server's website? And why does the wrong naming only happens when a backup is initiated with a cron job?

This happens only on Joomla 5 and Joomla 4 websites. On Joomla 3 websites, online backups initiated by cron jobs produce files with the expected correct names.

 

Below is the cPanel cron command I have for a Joomla 5 Akeeba Backup:

/usr/local/bin/php /home/<accountID>/public_html/cli/joomla.php akeeba:backup:take --profile=2

 

Below is the cPanel cron command I have for a Joomla 3 Akeeba Backup

/usr/local/bin/php /home/<accountID>/public_html/cli/akeeba-backup.php --profile=2

nicholas
Akeeba Staff
Manager

Akeeba Backup gets the hostname from the server environment. When this does not exist, e.g. under CLI, Akeeba Backup gets the hostname from a variable it has stored in the database when you last visited its Control Panel page. Since you transferred your site, you need to access Akeeba Backup's control panel page from a browser at least once so it can record the new hostname.

Moreover, please do check which backup profile is used by third party services. Then check the configuration of that backup profile has a backup filename which has the [HOST] variable instead of a hardcoded sites string in it.

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!

stavrosz

Thank you Nicholas,

I will adopt the habit of visiting the Control Panel after every online restoration.

In all my profiles ("online", "localhost", "database only"), I use the [HOST] and not a hardcoded website name.

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!