Snapshots not auto backing up as per schedule

Hi
I've got Snapshots configured on a stand alone site. I've scheduled it to backup once daily but it's not working. Works fine if I manually run the backup but the scheduled time comes and goes without the backup file being created.

I've checked the settings and they're identical to settings I use on another site and just can't work this one out.

Happy to grant support access if you'd like to take a look for me.

Many thanks

Chris

  • Sajid

    Hi Chris,

    Hope you are doing good today :slight_smile:

    Thanks for granting support staff access. I created a test snapshot with 5 minutes interval and its creating backup archives successfully and automatically.

    Please bear in mind that Snapshot uses WordPress Crone that is not substitute of real cron jobs and not 100% accurate because it totally depends on website traffic. So its 90% accurate even on really busy websites and also you should not run cron jobs on busiest time so its not resource intensive.

    In this scenario I will suggest you try real replacing WP Cron with real cron. You can still schedule backups in Snapshot in the same way you do before.

    Here is a nice tutorial on setting up real/system cron with WordPress or contact your host for assistance.
    http://support.hostgator.com/articles/specialized-help/technical/wordpress/how-to-replace-wordpress-cron-with-a-real-cron-job

    Also the other issue can be with memory and execution time. As your site keeps getting bigger it needs more resources to create a snapshot. Please try to further increase the memory and execution limit as described in this article and then check again.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Cheers, Sajid

  • brandicoot

    Hi Sajid

    Thanks for taking a look at the issue, however the problem still exists.

    I understand how the cron works and this isn't the problem. I can see that the scheduled snapshot begins ok - it just doesn't complete.

    The snapshot you configured, doesn't backup any files and is only configured to backup one table in the entire database. When I choose those same limited settings, the snapshot completes fine. Anything more, and it doesn't complete.

    I've followed the instructions in your link: https://premium.wpmudev.org/blog/increase-memory-limit/

    however, when I add the entries to the .htaccess file, it breaks the website with a server 500 error.

    Any other ideas?

  • Tyler Postle

    Hey Bandicoot,

    Hope you're doing well today!

    I think the problem here is your max execution time. It's set at 30 seconds, so basically if the snapshot takes longer than 30 seconds it will cause a timeout.

    Do you have any timeout errors in your server logs?

    At any rate, could you try adding this to your .htaccess file:

    php_value max_execution_time 180

    That should bump it up to 180 seconds. You can try 90 first if you think that would be enough.

    If adding that causes a 500 server error or if it doesn't make a difference then could you send us your FTP? Then we can investigate further :slight_smile:

    You can send that privately through our contact form: https://premium.wpmudev.org/contact/

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me.

    Send in:

    Subject: "Attn: Tyler Postle"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    **If you keep support access active then no need to send in wp-admin

    Look forward to hearing back!

    Cheers,
    Tyler

  • brandicoot

    Hi Tyler

    Adding that code to .htaccess gave me a 500 server error.

    However, I was able to increase the max_execution_time to 360 by editing the php.ini file.

    The problem still exists. The backup starts ok but never completes.

    I've extended support access.

    Edit: I just tried doing a manual one so I could watch the progress bars. It completed backing up all the db tables. It got to 97% of the plugins and then stopped and the attached error came up on screen

    Cheers
    Chris

  • brandicoot

    Hi, you can ignore that last error. I changed the zip method to PclZip in settings and that's no longer causing the issue.

    However, automatic backups are still not working.

    I've done some tests and it seems that I can do a full manual backup, no problem.
    I can also do scheduled backups - so long as they don't include the entire file structure.
    For example, if I select: "Include common files: Themes, Plugins, Media (wp-content/uploads)" - the backup fails.
    However, if I select "Include selected files:" and then choose anything or all options - so long as they don't include "Media Files: wp-content/uploads" - the scheduled backup is successful.

    In other words, scheduled backups (and only scheduled backups) fail to complete successfully (tho they do show as in progress for a couple of minutes) if any of the file backup options include the "Media Files: wp-content/uploads". Manual (run immediate) work fine.

    It's important that these files are included in the backup process so I need to get a fix for this.

    Cheers
    Chris

  • Tyler Postle

    Hey Chris,

    Thanks for the update here. Would you mind sending in the credentials I requested back in this post: https://premium.wpmudev.org/forums/topic/snapshots-not-auto-backing-up-as-per-schedule#post-1028415

    Then I can troubleshoot further and investigate the error logs :slight_smile:

    There are snapshot logs stored via: /wp-content/uploads/snapshots/_logs

    Those may give us a hint to what caused the snapshots not to complete.

    Talk to you soon!

    Cheers,
    Tyler

  • Tyler Postle

    Hey Chris,

    Thanks for sending that in. Very odd that it's not completing for the scheduled ones but then works fine the manual snapshots.

    I've just added the following constants to your wp-config.php:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );

    It will still hide all the debug messages from the frontend of your site and instead log them via:

    /wp-content/debug.log

    I'm going to let that run for a day then check back in tomorrow and we should fine some errors there that give us further info :slight_smile:

    Cheers,
    Tyler

  • Tyler Postle

    Hey Chris,

    Sorry about the delay here. I thought I set a reminder to come back to this but I guess not. Totally my mistake!

    I checked the debug log and not seeing anything related to Snapshot in there.

    I've flagged the developer on this and sent them a message to get them caught up on the issue.

    I'll reply back here once I hear back from them :slight_smile:

    If you could also re-grant support access in the meantime that would be helpful.

    Cheers,
    Tyler

  • Tyler Postle

    Hey Chris,

    I just heard back from the dev on this, sorry for such an extreme delay.

    The issue is that when performing the backup manually, it can do it in multiple calls. So it's less taxing on the server; however, the scheduled backups are done all at once. There isn't a way to perform that in multiple calls right now. So mostly due to the size of your media folder(~15gb) it pushes it to the edge and the server either runs out of memory or hits it's execution limit.

    As you noticed earlier, if you don't include the media folder then it will work as the bulk of the snapshot is there.

    With that said, I do have some good news too, we are working on Snapshot 3.0 right now which will be part of our Hub services and our Snapshot dev's are going to discuss this example specifically to make sure an issue like this doesn't happen once our backup/restore service goes live. We'll have a little more control over it at that point since our servers will be involved.

    I know this isn't the answer you were hoping for especially after waiting this long, but hopefully we'll get Snapshot 3.0 out soon. If you have any further questions on this just let me know.

    Cheers,
    Tyler

  • brandicoot

    Hi Tyler.

    Firstly, thanks for getting back to me. I appreciate the feedback.

    I understand what you're saying but our media folder isn't anywhere near 15gb. This entire cPanel, including mail folders, is only 2.5gb.

    What was as disappointing as the developer not being able to provide a solution was that whoever was working on this issue with back end access, took it upon themselves to change a configuration of a snapshot to backup up "every 5 minutes" with no limits as to the number of files.

    This meant that when I came in today after the long weekend, I found that there were around 1700 backup files on our server, each 50mb in size - causing our server drive to be over capacity. They'd also used the ftp details to upload a bunch of other fairly large gzipped files which weren't removed once they'd finished. All this caused our server drive to be over capacity and meant that another temporary backup process that I have in place could not complete.

    When we allow developer access and ftp access, we do so placing an enormous amount of trust that the people given this access will act professionally and will take the greatest care not to break systems that are in place and tidy up files and configurations that are no longer needed once they've finished their work.

    Thanks again for getting back to me and I look forward to the release of Snapshot 3.0

  • Sajid

    Hi @brandicoot,
    Hope you are doing good today :slight_smile:

    I am sorry to hear your server got over capacity because auto backups for testing purpose. I understand and agree that it should have been reverted back to normal (we do all the time btw). I apologize for the inconvenience and will also direct developer to take a very good care in future while dealing issues.

    Regarding your issue with DB backup. Are you sure your WP Cron is working just fine by installing this plugin.
    https://wordpress.org/plugins/wp-crontrol/

    I am unable to test it on your website because I could not find login credentials in private email and support access is not active anymore.

    Take care and have a nice day :slight_smile:
    Cheers, Sajid