LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-30-2004, 09:48 AM   #1
solex
Member
 
Registered: Dec 2003
Posts: 30

Rep: Reputation: 15
File Listing of a DAT Tape


Hello,
How can I get a file listing of my backup DAT tape?

Thanks,
Dan
 
Old 08-30-2004, 10:02 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,515

Rep: Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224
Some additional information is required...
So what application are you using to create the backups?
 
Old 08-30-2004, 10:05 AM   #3
solex
Member
 
Registered: Dec 2003
Posts: 30

Original Poster
Rep: Reputation: 15
I was using a script that simply tar'red the files and copied them to the tape.

Thanks,
Dan
 
Old 08-30-2004, 10:25 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,515

Rep: Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224Reputation: 6224
And how do you copy the tar files to tape?
 
Old 08-30-2004, 10:13 PM   #5
solex
Member
 
Registered: Dec 2003
Posts: 30

Original Poster
Rep: Reputation: 15
I used Tar to backup and copy the files. I found the answer to my question tar-tf /dev/st0, but now I need to know when the archive was made so I can find the latest tape that has the most recent backup. Does anyone know if and how this is possible?

Thanks,
Dan
 
Old 08-31-2004, 05:35 AM   #6
mad_ady
Member
 
Registered: Jan 2003
Location: I'm all in your mind!
Distribution: Debian
Posts: 248

Rep: Reputation: 30
It seems that tar has written directly to the tape. So, it's not a file on a filesystem on the tape. The tape contains the binary data (no filesystem).
So, there is no datestamp on the file (because it was dumped directly to tape). You could untar the tape to a temporary folder and check its contents for a recent date.

For the future, I suggest adding a blank file to the tape, named with the current date...

Something like this:
Code:
#!/bin/bash

#write a blank file named by today's date in the directory you wish to backup

$CURRENTDATE=`date`   #note the backquotes

touch "$CURRENTDATE" #note the normal quotes.
                    #it produces a file called like: Tue Aug 31 12:30:37 EEST 2004
#backup your files with the same command

#remove the date file
rm "$CURRENTDATE"

#you're done
Now, when you do a tar -tf /dev/whaterveryourtapeis it will list the files, and the file named from your date! Cool, huh?

Last edited by mad_ady; 08-31-2004 at 05:36 AM.
 
Old 08-31-2004, 08:33 AM   #7
solex
Member
 
Registered: Dec 2003
Posts: 30

Original Poster
Rep: Reputation: 15
Thank you for your help I will add your suggestion to my backup script.

Thanks!
Dan
 
Old 08-31-2004, 01:00 PM   #8
mad_ady
Member
 
Registered: Jan 2003
Location: I'm all in your mind!
Distribution: Debian
Posts: 248

Rep: Reputation: 30
Try it out to make sure there are no bugs!

Glad I could help.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DAT Tape Drive device name suab0871 Linux - Newbie 1 10-24-2005 11:54 AM
SCSI, DAT and DLT tape jimmy2002 Linux - Hardware 4 04-20-2004 08:02 AM
Can anyone help me with a DAT tape? drako12 Linux - General 5 03-11-2004 01:07 PM
DAT Tape drive sanw2k Linux - Networking 4 10-11-2003 12:16 AM
DAT tape pk21 Linux - Newbie 0 06-14-2002 07:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration