Advertisement:

Author Topic: SMF admin panel backup is crap! Can we have a patch release to remove it please?  (Read 32978 times)

MrPhil

  • Guest
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.

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

  • Guest
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.

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,380
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
[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]

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,469

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


MrPhil

  • Guest
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?

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

  • Guest
Well, it was worth asking. ;)


[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...

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
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

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
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

  • Guest
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.