Support » Plugin: All In One WP Security & Firewall » Database backups not deleting, then not saving

  • ërralb

    (@ierpe)


    Hi there,

    I setup an automated scheduled db backup, once per day, and to keep 30 backups.

    I just realized that after 30 backups were made, the old backups were not deleted and no new backups were added… is this a normal behavior?

    I checked the server permissions, the user can delete the backup files…

    Kind regards

    • This topic was modified 2 years ago by ërralb.
    • This topic was modified 2 years ago by ërralb.
Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi,

    I just realized that after 30 backups were made, the old backups were not deleted and no new backups were added… is this a normal behavior?

    What is your current database settings? Also does your site have visitors on a daily basis?

    Thank you

    Thread Starter ërralb

    (@ierpe)

    Hi, thanks for the answer.

    Yes the site has visitors daily.
    Could it be linked with a cache plugin? I am using WP Fastest Cache.

    What do you mean by database settings?
    This https://ibb.co/p1yxhxC ?

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Thank you for sharing the image with the settings.

    Let me explain to you how the schedule backup works with WordPress wp-cron functionality.

    The backup time is set at the time you save the automatic scheduled backup settings. In order for the backup to trigger around the time you expect it to, you will need some kind of site activity (such as someone visiting) just after that time.

    For example:

    If I’ve just configured my scheduled backup settings to do a once daily backup and saved the config now and it is currently 7:11pm at my location, then the wp-cron will be scheduled to perform a backup at around 7:11pm everyday. Which means that the next backup will be scheduled for tomorrow at approximately 7:11pm – BUT – as mentioned in my last response, if nobody visits my site till 10:30pm tomorrow, then no backup will occur at 7:11pm because there was no activity on the site just after 7:11pm to trigger the wp-cron event. What will happen is that the system will immediately trigger a backup as soon as someone visits my site anytime after the scheduled time. (In other words in this example the backup will occur at 10:30pm)

    On the next day the same thing applies…..the aiowps backup is still scheduled for around 7:11pm and if I get my next visitor at 7:12pm then the backup will be performed at 7:12pm.

    Let me know if the example above makes sense to you.

    Kind regards

    Thread Starter ërralb

    (@ierpe)

    Hey, I think I didn’t express my problem correctly.

    The backups are being generated just fine, it’s working, no problem there.

    The problem is on deletion of the old backups.

    As per my settings, I asked for 30 backups to be maintained.
    The problem is that once 30 backups have been generated, the plugin does not delete the old ones and does not save new ones, know what I mean?

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, yes I know what you mean.

    What I was thinking is that perhaps no more backups have been created because no one visited your site after the schedule cron job. However, I could be wrong with my theory and maybe something else is interfering with the backup process. Try the following. Delete 5 old backups. Then let it play through and check the results after 5 days. Also make sure you enable Debug mode. That will allow you to check the log file. The log file might reveal some information about this issue.

    Kind regards

    Thread Starter ërralb

    (@ierpe)

    Thanks, I already deleted some, I will check it out in the next days.

    I was thinking that maybe the Cache plugin is serving html files and that maybe it skips the wp-cron…

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi,

    I was thinking that maybe the Cache plugin is serving html files and that maybe it skips the wp-cron…

    I see your logic but I think that might not be the case. The reason being is, if it was as you say then the tens of thousands running our plugin in their sites would report that as well. Because just about everyone runs some sort of caching system.

    But I guess you just never know 🙂

    Kind regards

    Thread Starter ërralb

    (@ierpe)

    Hi, after couple of days of testing, the backups are still not generating correctly.

    I ended up adding a cronjob that’s calling the wp-cron.php directly with php, every hour, but still no luck…
    When I use the “Create DB Backup Now” button, it works fine, so it seems that’s it’s really related to the cron job but!?

    I am using a Roots Bedrock installation, which installs WordPress into a sub-folder. Do you think it could have an impact?
    I just noticed the backups aren’t working on another website which also uses Bedrock and your plugin…

    Any idea how I could debug this?

    Kind regards

    • This reply was modified 2 years ago by ërralb.
    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi,

    I have submitted a message to the developer to investigate further your issue.

    Thank you

    Thread Starter ërralb

    (@ierpe)

    Okay, let me know if you need anything.
    I’m a web developer and sys admin, so I can look into things technically if need be!

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, can you carry out a test.

    Delete 25 backups and only keep 5 in your list.

    Tests:
    1) Set “Number of Backup Files To Keep” to 5.
    Do 5 separate manual backups. Check the backups directory and verify that there are 5 backups.

    2) Set “Number of Backup Files To Keep” to 3.
    Do 2 more separate manual backups. Check the backups directory and verify that there are 3 backups only. (2 oldest backups from previously should have been deleted)

    3) Set backup time interval to 1 hour.
    Over a period of a day check the backup directory and verify that the number of backups is always as per the config.
    (Also check the “wp-security-log-cron-job.txt” file to verify that the logs show that backups were done)

    Let me know how you go.

    Thank you

    Plugin Contributor wpsolutions

    (@wpsolutions)

    Hi @ierpe,
    Please enable debug by going to:
    WP Security >> Settings >> Enable Debug

    The log files might at least give an indication whether backups are being attempted or if there is some failure somewhere.

    Thread Starter ërralb

    (@ierpe)

    Hi, thanks for the answer.
    I did everything you asked.

    The manual backups worked and deleted older backups correctly.
    The cron still isn’t working.

    The strange thing is when I call it directly with php on the server like this:

    php /my-web-path/web/wp/wp-cron.php

    I have no error, but the backup isn’t generated…
    I enabled debug, but there is no error…

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, I also carried out the same test in my dev site and it works in my end. I suspect that either a plugin is conflicting in your site or your sever is not running the cron job correctly.

    Kind regards

    Thread Starter ërralb

    (@ierpe)

    Yes I also suspect something like this. Thanks for the support.

    Just to make sure, to be testing on my end, if the backup configuration is set to one hour interval, and then I call manually the wp-cron.php from a terminal, it should work right?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Database backups not deleting, then not saving’ is closed to new replies.