Page Index Toggle Pages: 1
Topic Tools
Normal Topic Determine available backup methods (Read 2,000 times)
cepheid
Senior Member
****
Offline



Posts: 516
Re: Determine available backup methods
Reply #4 - Jul 2nd, 2009 at 11:09pm
Post Tools
deti wrote on Jul 2nd, 2009 at 10:49pm:
But as I wrote before: "until now this was not mentioned to be a problem to anyone."

But then, the Backup utility is pretty new and maybe people just defaulted to whichever utility was found without worrying about the others. Smiley

The check should look for the 4 executables (gzip, bzip2, tar, zip) in /bin, /usr/bin, and /usr/local/bin (in that order).  Ideally, it should also store the full path and use that in the display to the user (in the Backup Settings).

I guess I'll go through the code more carefully later... still working on the .lng files - that's a real bear!
  
Back to top
WWW  
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Determine available backup methods
Reply #3 - Jul 2nd, 2009 at 10:49pm
Post Tools
cepheid wrote on Jul 2nd, 2009 at 7:02pm:
But certainly the utility check seems to be missing,...

No. It's not missing. But you are right it could check in more places. At the moment it only checks for:
/bin/gzip
/bin/bzip2
/usr/bin/tar
/usr/bin/zip

But as I wrote before: "until now this was not mentioned to be a problem to anyone."
Smiley
  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Determine available backup methods
Reply #2 - Jul 2nd, 2009 at 7:02pm
Post Tools
deti,

Hmm, I must have missed the module check.  But certainly the utility check seems to be missing, because tar, zip, gzip, and bzip2 may be in /bin or /usr/bin (or even /usr/local/bin) ... I know that Backup.pl will pick them up no matter where they are, because of how it's coded, but I think it should probably check for and display the proper path.

I thought the module check wasn't done... I looked through the code, I guess I missed it.  Sorry!
  
Back to top
WWW  
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Determine available backup methods
Reply #1 - Jul 2nd, 2009 at 11:00am
Post Tools
Huh

This checking is already done. If the module/method isn't installed on your server you can not select it.

OK we don't check for /bin/tar, only for /usr/bin/tar. But until now this was not mentioned to be a problem to anyone.
  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Determine available backup methods
Jul 2nd, 2009 at 8:20am
Post Tools
Right now, all of the backup methods and command paths are hardcoded into Backup.pl.  The user is able to select a backup/compression method even if his server doesn't support it, e.g. the user can select Archive::Tar even if that module isn't installed.

It would be nice if Backup.pl would automatically determine the available methods and gray out any that are actually not available (plus disable the radio button), so that if e.g. Archive::Tar isn't installed, that entry will be grayed out and its radio button will be disabled.

I know that the front page of Admin Center contains a module checker, but that only provides info, and it only checks Perl modules... it doesn't check for the file utilities (e.g. /bin/tar).  Checking for the required modules and utilities isn't too hard, and doing it would prevent the admin from selecting options which will later cause fatal errors.

Also, the filepaths to the utilities are hardcoded in Backup.pl, e.g. tar is listed as /bin/tar even if it's actually in /usr/bin/tar.  This is irrelevant for actual operation because of the way Backup.pl is coded, but it could cause confusion if a user knows that his utilities are in different locations than what's shown, thinking that the backup would then fail because it's looking for the utilities in the wrong place.

It would be good if Backup.pl could check for the proper paths ahead of time... this can easily be done as part of the check to see if the utilities are even installed.  Backup.pl should then display the correct found path (if any), or gray out the option (if the utility isn't found).  This is primarily cosmetic since Backup.pl works without the hardcoded paths (it relies on the command being in $PATH), but I think it would be useful.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top