SMF admin panel backup is crap! Can we have a patch release to remove it please?

Started by kat, April 23, 2012, 02:37:18 PM

Previous topic - Next topic

MrPhil

Quote from: (F.L.A.M.E.R) on May 01, 2012, 10:46:16 PM
Yep, looking at the last few lines will give us the answers straight away, but that may need the use of vi or nano command on the server side
So long as you haven't yet compressed/gzipped the .sql file, it can be opened, seek to the end, back up a few hundred bytes, and read in the tail end of it. If it doesn't contain any sort of bad-looking message, you're golden. Close the file and compress it if desired.

Quote from: K@ on May 02, 2012, 05:43:49 AM
Thinking about archivers and the like, though, is it possible to do the equivalent of a Cyclic redundancy check? Maybe a checksum?
Yeah, but what are you going to compare it against to see if it's a valid file? The backup will be different every time. There's no fixed CRC/MD5 value to check against.

kat

Ah. Yeah, I had a feeling that that might be the sticking-point.

I wondered if there could be a check done, onsite, to say "This file should be xKB in size, when you get it, which, when the file gets download, would be matched against that.

Like, back in days of yore, the ol' "Verify" thing did, with tape saves, on the Spectrum, etc.

Chalky

[offtopic]

I had a Spectrum, 48K - I broke my heart when I spilt orange juice on it and it wouldn't work anymore.  No more "Horace Goes Skiing" for me....  :'(

[/offtopic]

Sir Osis of Liver


Can the backup function automatically place the forum in and out of maintenace mode?

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

MrPhil

Quote from: K@ on May 02, 2012, 11:46:09 AM
I wondered if there could be a check done, onsite, to say "This file should be xKB in size, when you get it, which, when the file gets download, would be matched against that.

Unfortunately, that doesn't tell you whether the backup file was complete in the first place, only that it was downloaded correctly. Even, then, going from Linux to Windows PC, the line-ends will change from \n to CRLF, inflating the size... you'd have to count the number of records and figure how much the size would change. Even then, I'm sure it would leave most forum owners thoroughly confused.

If the backup process is killed in the middle due to a timeout or other resource limitation, isn't there always a message at the end that we could look for?

Quote from: Krash. on May 02, 2012, 01:52:00 PM
Can the backup function automatically place the forum in and out of maintenace mode?

Of course it could (and should). The Settings.php file would have to be updated, so it would be a good reason to pull out the $maintenance variable into its own file (included into Settings.php), just like it would be a good idea to pull out the timestamp of the last database error into its own file (hint hint).

kat

Well, it was worth asking. ;)


Quote from: Sabrinova on May 02, 2012, 01:47:54 PM
[offtopic]

I had a Spectrum, 48K - I broke my heart when I spilt orange juice on it and it wouldn't work anymore.  No more "Horace Goes Skiing" for me....  :'(

[/offtopic]

I've still got mine, somewhere...

Angelina Belle

When the backup ends in the middle, it just ends.
I'll see if I can dig one up...
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

emanuele

Quote from: MrPhil on May 02, 2012, 02:05:11 PM
Quote from: Krash. on May 02, 2012, 01:52:00 PM
Can the backup function automatically place the forum in and out of maintenace mode?

Of course it could (and should). The Settings.php file would have to be updated, so it would be a good reason to pull out the $maintenance variable into its own file (included into Settings.php), just like it would be a good idea to pull out the timestamp of the last database error into its own file (hint hint).
It could but it shouldn't, without prominent notice at least.
And even so, you would be "in trouble" if the script dies due to a timeout or whatever error because it wouldn't be able to restore the forum to normal mode automatically (yes, that would be a notice that the backup is not good...not very user-friendly and with too many implications... and anyway I still prefer if the admin takes a moment to understand what he is doing and why he gets a warning).
As I wrote at the moment the devel version disables the button if the forum's size is big (well, of course this is an estimate) and maintenance is off, preventing (client side, but if you are crazy enough to force the download you know what you are risking) the download.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

MrPhil

Quote from: emanuele on May 02, 2012, 03:18:14 PM
Quote from: Krash. on May 02, 2012, 01:52:00 PM
Can the backup function automatically place the forum in and out of maintenace mode?

It could but it shouldn't, without prominent notice at least.
Of course the admin should be notified if the forum is being put into maintenance mode (which it should be for any size backup). The notice could include a quick reminder of what to do/check if for some reason it doesn't come back within a reasonable time.

Quote
And even so, you would be "in trouble" if the script dies due to a timeout or whatever error because it wouldn't be able to restore the forum to normal mode automatically
And that's why you remind the admin each time what's going on.

Quote
I still prefer if the admin takes a moment to understand what he is doing and why he gets a warning).
Incurable dreamer, eh? Most admins have no idea what's going on inside of SMF and cannot understand why this or that is happening. They just want and need a cookbook. Most admins are looking for an appliance, not a full time hobby.

Quote
As I wrote at the moment the devel version disables the button if the forum's size is big (well, of course this is an estimate) and maintenance is off, preventing (client side, but if you are crazy enough to force the download you know what you are risking) the download.
I feel that maintenance mode (1) should be turned on regardless of the estimated backup size, and that we need to do something to examine the log or backup to see if something bad happened. Do we have any experience with backup problems as to what the end of the file looks like? Does it have any consistent pattern to indicate success or failure?

Put a comment at the top of the .sql file saying that the SMF backup created it. Put a comment at the bottom of the .sql file saying "end of backup". If we see that, is there any reason we can't assume that everything in-between is OK and turn off maintenance mode?

P.S. The maintenance message in Settings.php should then be changed to something about "system maintenance is being performed..." to cover both backups and restores. Or, the text string could be dynamically updated (as a separate, included file) to indicate what's going on.

Advertisement: