ROOTVG

AIX => Administration => Topic started by: brent.weaver on April 07, 2008, 09:36:41 PM



Title: Backup using absolute path
Post by: brent.weaver on April 07, 2008, 09:36:41 PM
Hello all. I am hoping that the community can assist me with this. My company has a backup script that uses UNIX find command to build a list of files which get redirected into backup command. Since the backup was done with absolute path we cannot restore to an alternate location. I have been playing with the idea of chroot.?.?!!?

Does anyone have any suggestions on how to restore to an alternate path w/o having to dismount or go to another system.

Our script basically does this:

find /path/to/files > list_of_files
backup -ivqf /dev/rmt0.1 < list_of_files

Help!

Thanks in advance!


Title: Re: Backup using absolute path
Post by: John R Peck on April 07, 2008, 11:55:59 PM

chroot would be the only way to have the absolute backup restoring under a new root point.

In future put "./" in front of that find path to give yourself the flexibility.


Title: Re: Backup using absolute path
Post by: Michael on April 08, 2008, 12:57:50 PM
Depending on what conflicts there are with your current system you might be able to move information around using a symbolic link that redirects the wrong filepath info on tape to the location you want.

Other possibilities: create a file system at the point where the files go from tape. After restore, unmount and mount at location you want. Or, move the current directory to a different location, extract tape, move extracted files to new location, restore original directory to it's correct location.

However, if the backup is of / (as in root) this becomes MUCH more troublesome.


Title: Re: Backup using absolute path
Post by: brent.weaver on April 08, 2008, 02:54:34 PM
Guys - thanks SOO much for the prompt response. I played more with chroot but when I do I lost my path to the utilities, .i.e. the restore command. I cut and paste the example directly out of man page of chroot and it does not work.

It kind of makes sense why not. Here is the example:

root:/cacheplay # chroot /cacheplay pwd
pwd: No such file or directory
root:/cacheplay # ls /cacheplay
backup       cache.cpf    cforce       cstart       dev          docs         install.cpf  mgr          source
bin          cbackup      csp          cstop        devuser      install      lost+found   patrol
root:/cacheplay #

So I was thinking that if I needed the utilities could I run mksysb to an ISO image and then mount he ISO as my new root. It seems a bit extreme and crazy but i suspose possible!

Let me know!


Title: Re: Backup using absolute path
Post by: John R Peck on April 08, 2008, 10:07:46 PM

As with Rsh (restricted shell), the commands you want to run when chroot'ed all need to be made accessible first - i.e. in this case copy the executables for restore etc to some new area that is accessible to where you chroot to, and/or adjust your PATH.

If you chroot to /usr then you have all your stuff just down a new PATH.
Then as Michael suggests, if you make filesystems mounted off that with the
names of your old root mount points, you can move them around more easily later.  E.g. /usr/home.

The whole ISO mksysb thing not parity-checking with me  :-\


Title: Re: Backup using absolute path
Post by: brent.weaver on April 09, 2008, 09:30:52 PM
Hey guys... Since my last post I have learned ALOT! I basically figured out how to create this min env to chroot to. I basically use the ldd command on an exe (.i.e.) and copy the lib's relative to my new root. Doing this I certanly can restore to an alt path. Sine I do not have direct acces to /dev/rmt0 in the chrooted env I have to get the backup file from tape to disk as a bacup/restore file...


This is beyond the context of this post, I am opening a new one!

Thank you ALL for the GREAT support here. This is a great forum and OS!