OpenID
Log In | Register
Skip to main content
Topic: Script is not deleting older backups (Read 272 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.
Script is not deleting older backups
The script is not deleting older backups from FTP, I do have a cron job running for the ftp_retention.php they are as follows

Error log

[19-Aug-2020 00:02:04 Europe/London] PHP Warning:  ftp_delete(): "/" is your current location in /home/xxxxxxx/v2/ftp_retention.php on line 18

Have sent you an email  (Mon, 24 Aug, 14:37) & added an issue on bitbucket with all required information just not heard anything back.

Any news on looking at the issue?

 
Re: Script is not deleting older backups
Reply #1
Hi,

I'm really sorry for not getting back to you. I've recently had to minimise support to this script due to COVID-19 work issues and the arrival of my first child.

After spending a bit of time testing, it would appear on your setup, the reason for the issue is the execution time. The root cause of the issue relates to the ftp retention script checking if each file is actually a file or is actually a directory. It seems to be that for the first file this takes 1 second, for the second file it takes 2 seconds and for the third file it takes 3 seconds and so on. With the number of backups you have, this can cause the FTP_CHDIR command to take over 40 seconds in some cases causing the script to time out. This is a bug with what seems to be PHP and the FTP server.

It should be noted that this should not happen. I'm currently looking into modifying the ftp retention script to do this check an alternative way and therefore significantly reduce the time and stop the error occurring. I will hopefully have an answer over the next few days.

Once again, I apologise for the delay in my response to you. I am still supporting this script, however I won't be able to respond as quickly as I usually do and may now take a few weeks to resolve issues.