Support

Akeeba Backup for Joomla!

#8554 Using backup.php cron job ftp remove (delete) files older than x

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 Sunday, 08 August 2010 09:18 CDT

aspensystems
Hello

We are using a CRON job executing backup.php, the backup works well each Saturday evening to the ftp directory.

I would also like to delete files older than 60 days in the destination ftp folder.

Is there a way in backup.php to add this command?

Thank you in advance

dlb
Akeeba can't expire backups that have been transferred to another ftp server. The internal backups can be deleted based on total size of the backups or number of backup files. Does this answer your question?


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

aspensystems
Hello dlb

Actually I am aware that it there is not a setting in akeeba to do this

I was hoping for a piece of script to add to backup.php that would delete the file older than 60 days in the ftp folder on the destination server.

We could do a cron on the destination ftp folder/server, but would like just one process of

"backup domain / login to ftp / ftp backup file to folder / remove file older than 60 days / logout / process complete".

Is there any way to add the delete files older than 60 days in backup.php?

Here is a cron command “find site-* -maxdepth 0 -mtime +60 -type d -exec rm -rf {} \;”

Can this (or something similar) be executed from within backup.php while logged into ftp?

Thank you for your help

dlb
Sorry, I don't speak much "Command Line" and Google translate doesn't seem to work on it. :D I'll flag this for Nicholas.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

nicholas
Akeeba Staff
Manager
The find command only operates on local files. Doing a conditional delete of remote files can't be accomplished - as far as I know - with standard Linux tools. You would normally need a custom program to browse the remote FTP repository, get a list of files older than X days and then issue FTP DELE commands against them. This is a non-trivial piece of code, which should be able to accomplish in about 100 lines of PHP code. You can probably talk to a web developer about it, I believe that any developer with over 6 months of experience should be able to handle it for a very reasonable price.

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!