LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices

Reply
 
Search this Thread
Old 06-05-2013, 01:59 AM   #1
Fracker
Member
 
Registered: Mar 2009
Posts: 77

Rep: Reputation: 0
[Backup Restore] Remove "/" or define destination path


Hi guyz,

I am taking file system backup on Tape by

find /Backup -print | sudo /usr/sbin/backup -i -v -f /dev/rmt0;

now issue is, my backup on the tape is going with "/Backup/a/b/c.file" etc, while restoring I am getting issue That I need to mount /Backup directory with different partition.

Is it possible to define the path file restoring? or remove "/" like we can do in "tar" command?
 
Old 06-05-2013, 03:07 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Can you explain a bit more what you run into?

It has been a while since I used AIX, but if I recall correctly the backup command uses relative path by default.
Too refresh my knowledge I did a little search and came up with this link that might help:

- Relative and absolute backups with backup and restore
 
Old 06-07-2013, 01:07 AM   #3
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 275

Rep: Reputation: 118Reputation: 118
Hi there,

Two suggestions, depending on the specific requirements & environment:

1. If it is possible to temoporarily remount filesystems, the easiest solution would be to mount the target filesystem as /Backup.

2. You could chroot into the destination directory to restore to there (assuming the target directory is empty). To do this, you need to just copy the restore command & related files into the directory first, though. I simulated this with the following steps (backed up /tmp, and restored to /test2/; using a file /test1/rmt0 for the backup as I don't have a tape drive):
Quote:
## Set some locations
srcdir=/tmp
targdir=/test2
backupfile=/test1/rmt0
# $backupfile could be /dev/rmt0 in your case
## Do the backup
find $srcdir -print | backup -iqvf $backupfile
## Copy necessary files to target dir
mkdir $targdir/usr
mkdir $targdir/usr/sbin
mkdir $targdir/usr/lib
cp -p /usr/sbin/restore $targdir/usr/sbin
cp -p /usr/sbin/restbyname $targdir/usr/sbin
cp -p /usr/lib/* mkdir $targdir/usr/lib
# Ignore the errors like "cp: 0653-436 /usr/lib/xorg is a directory. Specify -r or -R to copy." on the last step; we don't need the subdirectories
## Restore the files to $targdir
chroot $targdir /usr/sbin/restore -dqf - < $backupfile
# Clean up temporary files
rm -r $targdir/usr
# Move files into correct place
mv $targdir/$srcdir/* rmdir $targdir/$srcdir/.??* $targdir/
rmdir $targdir/$srcdir
I hope this helps!
 
1 members found this post helpful.
Old 06-07-2013, 01:10 AM   #4
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 275

Rep: Reputation: 118Reputation: 118
Forgot to mention: for future backups you can avoid this problem by using relative paths in your backup, as follows:

Quote:
cd / && find ./Backup -print | sudo /usr/sbin/backup -i -v -f /dev/rmt0;
 
1 members found this post helpful.
Old 06-20-2013, 03:53 PM   #5
Michael AM
Member
 
Registered: May 2006
Distribution: AIX 5.3, AIX 6.1, AIX 7.1
Posts: 95

Rep: Reputation: 23
A different solution is to create a symbolic link between /Backup and /some/where/else

# ln -s /some/where/else /Backup
 
Old 06-20-2013, 03:59 PM   #6
Michael AM
Member
 
Registered: May 2006
Distribution: AIX 5.3, AIX 6.1, AIX 7.1
Posts: 95

Rep: Reputation: 23
clifford: good idea, however, -print is not needed. neither is sudo generally (sudo is often not installed)

so
Code:
# cd /somewhere/..
# find ./somewhere | backup -if /somewhereelse/backup.bff
or
Code:
# find ./somewhere | backup -if /dev/rmt0.1
fyi: on my system old enough to even have a tape - the default file settings:
Code:
mamfelt@x121:[/home/michael]ls -l /dev/rmt*
crw-rw-rw-   1 root     system       42,  0 Mar 31 12:15 /dev/rmt0
crw-rw-rw-   1 root     system       42,  1 Mar 31 12:19 /dev/rmt0.1
crw-rw-rw-   1 root     system       42,  2 Mar 31 12:11 /dev/rmt0.2
crw-rw-rw-   1 root     system       42,  3 Mar 31 12:11 /dev/rmt0.3
crw-rw-rw-   1 root     system       42,  4 Mar 31 12:11 /dev/rmt0.4
crw-rw-rw-   1 root     system       42,  5 Mar 31 12:11 /dev/rmt0.5
crw-rw-rw-   1 root     system       42,  6 Mar 31 12:11 /dev/rmt0.6
crw-rw-rw-   1 root     system       42,  7 Mar 31 12:11 /dev/rmt0.7
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to remove a "single dot" entry in $PATH on openSuSe 11.4 ? giui_977 Linux - Distributions 4 01-04-2013 11:28 AM
remove "Suspend" and "Hibernate" from the "Shut Down" applet cccc Debian 2 05-02-2011 10:05 AM
[URGENT]how to remove "../.." from a path vikashtulsiyan Programming 3 08-29-2008 07:00 PM
How might I restore kmail folders/mail/settings from a "badly" saved "home"? deh6 Linux - Software 5 03-08-2008 09:25 PM
dump + restore to backup linux ; "Couldn't find matching filesystem: LABEL=/" on boot markus1982 Linux - General 4 09-21-2002 01:16 PM


All times are GMT -5. The time now is 11:45 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration