Support

Akeeba Backup for Joomla!

#39160 What is the best way to delete the log files

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 nicholas on Monday, 03 July 2023 12:03 CDT

mbcs

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 10MiB, please upload it on your server and post a link to it.

 

Is there a way in the Backup control panel to delete the log files?  Was not able to find.  We store offsite the backups and maintain the list of backup info in Manage Backups and want to keep.  However, there doesn't seem to be a way to delete the log files and over time they consume a lot of storage.  We want to keep the overall backup info under Manage Backups.  Just want to delete the log files.  If not a way to do via control panel and we go in and manually delete the files, will that reflect properly in the Manage Backups or is there a master log that the panel reads from?  Thanks in advance.

nicholas
Akeeba Staff
Manager

You can delete the log files directly using FTP, SFTP, your hosting control panel's file manager, or even a script which runs periodically.

For example, if you want to delete all log files which are older than 30 days and your backup output directory is /home/myuser/backups you need to create a CRON job with the command 

find /home/myuser/backups -Btime +30d -name "akeeba.*.log*" -delete

You can run this CRON job every week or so, depending on how often you want to remove log file.

Moreover, keep in mind that log files are useful primarily for troubleshooting. If you have a stable backup you can go to your backup profile's settings and set the Log Level to Errors And Warnings. This will essentially create an empty file unless there are errors and/or warnings during the backup, alleviating the problem.

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!

mbcs

Thanks for the information!  Really appreciate.

mbcs

Cron worked great.  However, your system still thinks the logs exist and this is what I was hoping would also get updated.  The Manage Backups area should have accurate and reliable data.  Suggest a Feature Request that would manage log files and present accurate data.  Thanks in advance.

nicholas
Akeeba Staff
Manager

The Manage Backups page does not check if the log file exists. It always shows a View Log button. When you click that button and if the log file does not exist you are told as much. This will not change.

We don't check for the presence of log files for performance reasons. Log files can have one of two different file name formats with two different extensions and they can be present either in the current output directory or the directory recorded at backup time in the backup record. This means that we'd have to check for the existence of 2 x 2 x 2 = 8 different files for each backup record. Displaying the default 20 records would need to check for the existence of 160 files. This starts getting very slow, especially on the more inexpensive servers.

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!

mbcs

Thanks for the update.

nicholas
Akeeba Staff
Manager

I forgot one more thing. There is an option in each backup profile, under the quota settings, to limit the number of obsolete records. When an obsolete record is automatically deleted, so does its log file.

I am not sure if that's something that would work in your use case. If I understand correctly you want to remove the log files but keep the database records, in which case this feature does not help you.

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!