Koozali.org: home of the SME Server

Selective File Restore from Server

Offline chrisj

  • **
  • 27
  • +0/-0
Selective File Restore from Server
« on: July 23, 2009, 01:57:06 PM »
Hi

I need to restore just one file from last Friday from our Server but can't find out either the command line instruction for this or where to restore using the GUI using the standard backup software Flexbackup. You can select a particular file using the GUI using Selective Restore from Workstation but not the Server. Can anyone give me pointer please?

Thanks

Offline Hans

  • *
  • 6
  • +0/-0
Re: Selective File Restore from Server
« Reply #1 on: July 24, 2009, 01:07:05 AM »
looking at the code in /etc/e-smith/events/restore-tape/S10tape-restore-flexbackup  i'd try the following:


cd /usr/tmp
mt -f $device rewind
mt -f $device fsf 1
flexbackup -extract -onefile <yourfile>


this should extract <yourfile> underneath /usr/tmp. i believe that files are archived on tape with non absolute path names. the value for $device you can find with grep device /etc/flexbackup.conf. you might have to provide -d blksize=<blocksize> to flexbackup. look at the code (script) mentioned above to find out how <blocksize> is calculated.
...

Offline chrisj

  • **
  • 27
  • +0/-0
Re: Selective File Restore from Server
« Reply #2 on: July 28, 2009, 11:45:44 AM »
hi badmeischter

Thanks for the pointer. I have tried your advice but I get the following results:-

[root@fserver1 ~]# cd /usr/tmp
[root@fserver1 tmp]# mt -f $dev/nst0 rewind
/nst0: No such file or directory
[root@fserver1 tmp]# mt -f $device /dev/nst0 rewind
mt: unknown command "/dev/nst0"
usage: mt [-v] [--version] [-h] [ -f device ] command [ count ]
commands: weof, wset, eof, fsf, fsfm, bsf, bsfm, fsr, bsr, fss, bss, rewind,
          offline, rewoffl, eject, retension, eod, seod, seek, tell, status,
          erase, setblk, lock, unlock, load, compression, setdensity,
          drvbuffer, stwrthreshold, stoptions, stsetoptions, stclearoptions,
          defblksize, defdensity, defdrvbuffer, defcompression, stsetcln,
          sttimeout, stlongtimeout, densities, setpartition, mkpartition,
          partseek, asf.
[root@fserver1 tmp]# mt -f $device/dev/nst0
-bash: [root@fserver1: command not found
[root@fserver1 tmp]# usage: mt [-v] [--version] [-h] [ -f device ] command [ count ]
-bash: usage:: command not found
[root@fserver1 tmp]# [root@fserver1 tmp]#
-bash: [root@fserver1: command not found
[root@fserver1 tmp]#

I have tried all combinations for the device which is /dev/nst0 but can't seem to get any further. Am I just using the wrong syntax or is something else not right?

Chris

Offline Hans

  • *
  • 6
  • +0/-0
Re: Selective File Restore from Server
« Reply #3 on: July 28, 2009, 12:02:54 PM »
Chris,

in the examples i provided in my original post you have to set the variable device or replace '$device' by whatever your device name is. from your last reply i figure it is /dev/nst0. in the example below i use the approach of setting the variable device, so i can simply copy past the command line examples:

export device=/dev/nst0
mt -f $device rewind
mt -f $device fsf 1


hope that helps
...

Offline chrisj

  • **
  • 27
  • +0/-0
Re: Selective File Restore from Server
« Reply #4 on: July 28, 2009, 12:37:01 PM »
hi badmeischter

Thanks badmeischter that works. It recognises the device and is ready for the restore. The only thing is I think it needs the full path of the original file as I now get the following response:-
[root@fserver1 ~]# cd /usr/tmp
[root@fserver1 tmp]# mt -f /dev/nst0 rewind
[root@fserver1 tmp]# mt -f /dev/nst0 fsf 1
[root@fserver1 tmp]# flexbackup - extract -onefile Loyalty card customers.xlsx

flexbackup version 1.2.1 (http://flexbackup.sourceforge.net)
/etc/flexbackup.conf syntax OK

 $keyfile not found in config: default=00-index-key
Errors:
 Nothing to do (see -help).

Can you confirm my thoughts.

Thanks again for all your help.

Chris

Offline chrisj

  • **
  • 27
  • +0/-0
Re: Selective File Restore from Server
« Reply #5 on: July 28, 2009, 01:02:04 PM »
hi badmeischter

Ignore last post. I've put the full path in and hey presto the file is now restoring. Thanks again for your help. This info is now going into my knowledge base!

Chris