06-03-2008
do the follow
before you backing up file or dirctory check your tape diveice
#lsdev -C -c tape
result ------> rmt0 Available 01-08-00-0,0 LVD SCSI 4mm Tape Drive
hier tape dev is rmt0
and using "tar" you can only restore same path (your backup path)
this is commands
TAR ARCHIVE
-----------
tar -cvf (filename or device) ("files or directories to archive")
eg:- tar -cvf /dev/rmt0 "/usr/*"
TAR RESTORE
-----------
tar -tvf (filename or device) Lists archive
tar -xvf (filename or device) Restore all
tar -xvf (filename or device) ("files or directories to restore")
use -p option for restoring with orginal permissions
eg:- tar -xvf /dev/rmt0 "tcpip" Restore directory and contents
tar -xvf /dev/rmt0 "tcpip/resolve.conf" Restore a named
thanks
herath
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I backed up a unix database using
"tar -cvf /dev/rmt1 -N 800 /*"
Normally I would restore this using
"tar -xvf /dev/rmt1 -N 800"
This is reporting an error about
"not enough memory"
I have done a new test backup and restore using the same commands and they work.
ANY IDEAS ? (2 Replies)
Discussion started by: Ross.Goodman
2 Replies
2. Solaris
We use tar for backing up a server.
I need to restore just one file from this backup.
Anyone know the syntax? (2 Replies)
Discussion started by: frustrated1
2 Replies
3. UNIX for Dummies Questions & Answers
I created a relative backup of my home directory using tar into a file named backup.tar.
No problem there.
I checked it out using the table of contents command to list the contents of the backup.tar file, and there is no problem there either.
But, when I tried restoring backup.tar into a... (2 Replies)
Discussion started by: Relykk
2 Replies
4. UNIX for Dummies Questions & Answers
hi there,
anybody know if there is any efficient way of restoring only
files of specific dates from a tape (with tar command)? :rolleyes:
coz the tapes containing few weeks' files,
but i need only files of a few days.....
any kind feedback is appreciated.
Thanks in advanced. (0 Replies)
Discussion started by: newbie168
0 Replies
5. UNIX for Advanced & Expert Users
Hi all,
How to untar a file with .tar.tar extension. A utility that i downloaded from net had this extension.
Thanks in advance,
bubeshj. (6 Replies)
Discussion started by: bubeshj
6 Replies
6. UNIX for Advanced & Expert Users
Hi,
On my Unix Server in my directory, I have 70 files distributed in the following directories (which have several other files too). These files include C Source Files, Shell Script Source Files, Binary Files, Object Files.
a) /usr/users/oracle/bin
b) /usr/users/oracle... (1 Reply)
Discussion started by: marconi
1 Replies
7. Solaris
Hi folks,
I have an image backup of an entire file system (Solaris 9 on N240) on a tar file.
How can I use this tar file to retore my system?
Thanks,
omd (1 Reply)
Discussion started by: omd
1 Replies
8. Shell Programming and Scripting
Hi all,
I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies
9. Red Hat
This will be covered elsewhere im sure but i just cant seem to find my exact issue.
I want to backup my systems using tar, command is:
tar -cjpf /backup /bin /etc /home /opt /root /sbin /usr /var /bootWhen i include the / directory it also tar's the /lib /sys /proc /dev filesystems too (and... (8 Replies)
Discussion started by: Tommyk
8 Replies
10. HP-UX
I tarred a directory to a different location. I then deleted the original directory.
Now I need to restore the directory, and I am unable to do so (The contents do not get restored). However, when I type tar -tvf <tarfile), the list of contents are displayed :
# tar -tvf lhs20170405.tar... (7 Replies)
Discussion started by: anaigini45
7 Replies
LEARN ABOUT CENTOS
tar_extract_glob
tar_extract_all(3) C Library Calls tar_extract_all(3)
NAME
tar_extract_all, tar_extract_glob, tar_append_tree - high-level tar archive manipulation functions
SYNOPSIS
#include <libtar.h>
int tar_extract_all(TAR *t, char *prefix);
int tar_extract_glob(TAR *t, char *globname, char *prefix);
int tar_append_tree(TAR *t, char *realdir, char *savedir);
VERSION
This man page documents version 1.2 of libtar.
DESCRIPTION
The tar_extract_all() function extracts all files from the tar archive associated with the TAR handle t into the path named by the prefix
argument.
The tar_extract_glob() function extracts all files matching the given glob pattern from the tar archive associated with the TAR handle t
into the path named by the prefix argument.
The tar_append_tree() function appends all files from the directory tree named by realdir to the tar archive associated with the TAR handle
t. The pathnames stored in the tar archive are modified by replacing realdir with savedir, so that the files will be extracted into
savedir.
RETURN VALUES
On successful completion, these functions will return 0. On failure, they will return -1 and set errno to an appropriate value.
ERRORS
These functions will fail under the same conditions that the tar_skip_regfile(), tar_extract_regfile(), opendir(), lstat(), or
tar_append_file() functions fail.
SEE ALSO
opendir(2), lstat(2), tar_skip_regfile(3), tar_extract_regfile(3), tar_append_file(3)
University of Illinois Jan 2001 tar_extract_all(3)