Restoration of back ups taken on Dat through tar -cvfr /dev/st0 – RHEL 5.0

Backup and restore
Backups are being taken on Dat DDS4 format OS RHEL 5.0. The command is used tar -cvfr /dev/st0 File name. Thus the backups are being taken no of times in one Dat. How to restore the backup of a file which has been taken after first occurence?

Software/Hardware used:
RHEL 5.0 + IBM quard Processor

Answer Wiki

Thanks. We'll let you know when a new response is added.

If I am not wrong, it sounds like, DDS4 is kind of Tape Drive….
Display list of files on tape drive:
# tar -tzf /dev/st0
Restore the file
#cd /
# mt -f /dev/st0 rewind
# tar -xzf /dev/st0 <filename>
Unload the tape:
# mt -f /dev/st0 offline
OR u may restore the same by the following command:
# tar -xlpMzvf /dev/st0 /home
x = extract files from an archive
l = list the contents of an archive
p = ignore umask when extracting files
M = create/list/extract multi-volume archive (optional)
z = Compress backup using gzip
v = verbose mode
f /dev/st0 = Tape device name

Thanks !

Discuss This Question: 2  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • petkoa
    Cited from the GNU tar documentation: ============================================ If you use ‘--append’ to add a file that has the same name as an archive member to an archive containing that archive member, then the old member is not deleted. What does happen, however, is somewhat complex. tar allows you to have infinite number of files with the same name. Some operations treat these same-named members no differently than any other set of archive members: for example, if you view an archive with ‘--list’ (‘-t’), you will see all of those members listed, with their data modification times, owners, etc. Other operations don't deal with these members as perfectly as you might prefer; if you were to use ‘--extract’ to extract the archive, only the most recently added copy of a member with the same name as other members would end up in the working directory. This is because ‘--extract’ extracts an archive in the order the members appeared in the archive; the most recently archived members will be extracted last. Additionally, an extracted member will replace a file of the same name which existed in the directory already, and tar will not prompt you about this(10). Thus, only the most recently archived member will end up being extracted, as it will replace the one extracted before it, and so on. There exists a special option that allows you to get around this behavior and extract (or list) only a particular copy of the file. This is ‘--occurrence’ option. If you run tar with this option, it will extract only the first copy of the file. You may also give this option an argument specifying the number of copy to be extracted. Thus, for example if the archive ‘archive.tar’ contained three copies of file ‘myfile’, then the command tar --extract --file archive.tar --occurrence=2 myfile would extract only the second copy. See section —occurrence, for the description of ‘--occurrence’ option. ============================================
    3,140 pointsBadges:
  • petkoa
    To avoid confusion: -r is the shortopt for for the longopt --append Petko
    3,140 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: