Extension, Module

Archived
Forum
(read-only)


For official support, visit the official support site »

Backup Pro

ExpressionEngine 2, ExpressionEngine 3

Back to this add-on's main page
View Other Add-ons From mithra62

     

File backup not being saved with type=combined

Support (Resolved)

Tyssen
Tyssen

I’ve run wget http://www.domain.com.au?ACT=1&type=combined via cron and it saved a database backup but not a file backup.

I haven’t tried running the URL from a browser because there’s several 100 Mb of images on the server and it would take ages for it to complete.

So what steps are available to troubleshoot why it’s not saving file backups?

mithra62
# 1
Developer
mithra62

Hi John,

Hmm… from your description, my initial instinct is that you may be trying to backup more than the server limits themselves can withstand. Even running from command line PHP be constrained by the environment settings and configuration.

My advice would be to split the Cron into 2 separate backups so the one doesn’t influence the other.

Eric

Tyssen
# 2
Tyssen

I tried that and got a db backup but still no file backup. Any minimum system requirements or PHP config settings I need to be aware of?

mithra62
# 3
Developer
mithra62

Can you enable debugging in your EE index.php file and run the File backup Cron URL in your browser again? Sounds like there may be some errors going on here…

Eric

Tyssen
# 4
Tyssen

Tried that. Page just hangs but I can see in the status bar that something is happening and because it’s a large backup I just left the page and went about my work. Several hours later I found the page had stopped processing saying the connection was interrupted (browser error message, rather than server error).

Tyssen
# 5
Tyssen

So what’s my next step?

mithra62
# 6
Developer
mithra62

Honestly John, I’m not sure. It’s certainly possible you’re trying to backup more than is reasonably possible using Backup Pro on your environment.

I think this may be something I have to take a look at personally. Can you send me the license number for the site in question so I can see if this qualifies for free support?

Eric
eric at mithra62 dot com

Paul vdW
# 7
Paul vdW

Looks like our issue is similar to Tyssen’s. File backups never work via a cron job, but DB backups do.

Running file backup from within the CP does work though - including the copy to S3.

Tyssen, are yours working from within CP?

Paul vdW
# 8
Paul vdW

I should add that file backups work when directly accessing the URL within the browser.

Is there a php command that can be run via CRON rather than a wget?

mithra62
# 9
Developer
mithra62

Hi Paul,

Absolutely; wget is just a tool like any other. Curl works as well as would any tool to hit up a URL.

Eric

Paul vdW
# 10
Paul vdW

Thanks for responding.

Yes, you’re right about wget/CURL, but I think you misunderstood my point. Requesting a URL requires that the webserver process the request and pass it to the PHP interpreter. When speaking of a php command run via CRON what’s being referred to is PHP from the command line. This avoids any timeouts, memory limits, etc. associated with the webserver and webserver-to-php-interface.

Hence the request for a direct php command (php cli).

mithra62
# 11
Developer
mithra62

Oh, you’re right; completely missed your point.

Unfortunately though, since Backup Pro is an ExpressionEngine add-on, and EE doesn’t have any CLI capabilities, Backup Pro can’t either. It’s really a problem I can’t fix without completely decoupling every aspect of the backup process from any core ExpressionEngine functionality which, while a great idea, isn’t really feasible without a TON of effort in terms of reinventing lots of wheels. It’s really not practical at this point, you know?

Eric

Paul vdW
# 12
Paul vdW

Good point! I was about to agree with you since I’ve never heard of EE cli access, but I did a search and came with this:

https://github.com/rsanchez/ExpressionEngine-Bootstrap

A quick play reveals that it doesn’t work with our multi-env config since that’s currently dependant on superglobals like $_SERVER.

mithra62
# 13
Developer
mithra62

Yeah, I imagine you’d have quite a few issues using that and it’s not something I could support. Not officially anyway.

One idea that comes to mind, and forgive me for shilling here, is an add-on of mine called Automat:ee.
http://devot-ee.com/add-ons/automatee

Automat:ee allows you to setup Cron style jobs within EE using just a template tag so you can schedule things without using wget or similar. Not sure if it’ll work for your situation but thought I’d throw it out there.

One thing I’ll look into though for a future release is creating a PHP script that can be called from CLI that’ll allow backups to be created without EE being involved.

Eric

Paul vdW
# 14
Paul vdW

Managed to fix my multi-env issues and can now var_dump(ee()). If I’ve got time tomorrow I’ll test issuing other commands via the CLI interface.

Don’t worry that you’ve mentioned Automat:ee, good for ones to know about it. From the looks of things the “CRON type = Module” in Automat:ee is basically doing what this CLI interface is doing, just without the manual steps needed to configure CLI for EE.