So today I took some of my precious time to investigate the problem. I found out that the problem was on line 803:
find "${CONFIG_backup_dir}/${subfolder}${subsubfolder}" -mtime +"${rotation}" -type f -exec rm {} \;The rotation-parameter was configured to be "0". No problems with that as we only want to keep the latest backup file that was created today. But the mtime function with find is the problem where the argument to mtime are the number of whole days. While some backup-files wasn't created (or modified) a whole day from the current time.
-mtime nSo this is the problem. Now the solution can be fixed in various of ways. But I just needed a quick fix to this as I always want to only keep the latest mysql database backup files. So I modified that line (in particularly and some others just on case I need something else than 0 in rotation configuration) to:
The primary shall evaluate as true if the file modification time subtracted from the initialization time, divided by 86400 (with any remainder discarded), is n.
find "${CONFIG_backup_dir}/${subfolder}${subsubfolder}" -mmin +$((60*23)) -type f -exec rm {} \;As you can see from above, I'm looking for files that is 23 hours or older. So this covers my gap of backup file creation time.
I'm happy if this helps you out. AutoMySQLBackup is a great script but not really maintained the best.