LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-31-2002, 10:29 AM   #1
dguy
Member
 
Registered: Dec 2001
Location: Beckwith Township, Ontario, Canada
Distribution: Slackware 14.0, Slackware-64 14.1
Posts: 119

Rep: Reputation: 16
Question DAT with tar/mt


I'm attempting to write multiple archives to a tape, but I'm missing something...

I thought that this would work:

tar -cf /dev/nst0 /dir1
mt-st -f /dev/nst0 eod
tar -cf /dev/nst0 /dir2
mt-st -f /dev/nst0 rewind

Checking the tape with tar -xvf /dev/nst0, all which appears to be on the tape is the contents of /dir1.

My guess is that I'm either writing the data to the tape incorrectly, or I'm not using tar correctly to check the tape's contents.

Can anyone point me in the right direction?

TIA...
 
Old 09-01-2002, 10:55 AM   #2
dwd
Member
 
Registered: Aug 2002
Distribution: RedHat / Debian / Ubuntu
Posts: 35

Rep: Reputation: 15
tar cf /dev/nst0 /dir1 /dir2 will work fine.
 
Old 09-02-2002, 10:16 AM   #3
dguy
Member
 
Registered: Dec 2001
Location: Beckwith Township, Ontario, Canada
Distribution: Slackware 14.0, Slackware-64 14.1
Posts: 119

Original Poster
Rep: Reputation: 16
I agree that <tar cf /dev/nst0 /dir1 /dir2> will work, however there is another application which I have in mind it will not work for.

I'm going to be setting up a script and a CRON job to perform incremental backups at regular intervals--to pull this off, I would like to be able to append a tar file to a tape which already contains data.

Last edited by dguy; 09-02-2002 at 10:17 AM.
 
Old 09-02-2002, 10:18 AM   #4
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
Why not use a piece of backup software to manage this for you?

http://www.amanda.org

Regards
 
Old 09-17-2002, 03:33 PM   #5
dguy
Member
 
Registered: Dec 2001
Location: Beckwith Township, Ontario, Canada
Distribution: Slackware 14.0, Slackware-64 14.1
Posts: 119

Original Poster
Rep: Reputation: 16
Why not? 'cause my initial thought was to do it all myself for the learning experience.

I'm curious about Amanda though--before spending the time downloading & building it, do you have any idea if it requires X-Windows? I couldn't find that information after buzzing through the FAQ at sourceforge, and the system which I would be installing it upon is command-line only.
 
Old 06-26-2003, 06:54 PM   #6
bqh
LQ Newbie
 
Registered: Mar 2003
Posts: 19

Rep: Reputation: 0
Amanda does not require X nor does it have GUI.
It uses the native system dump or tar to back up
data, and has its own way of managing the index
database.
 
Old 06-26-2003, 08:27 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,323

Rep: Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905
I'm thinking no need to go to eod since nst0 will not rewind and the tape will be at eod anyway.

I can't prove this since my tape drive is off but the tape will stop and the end of file marker on the first file written to tape.

The status option of mt will tell you how many files were written and the location of the tape drive. When you restore the first file where is the tape location? It should be at the beginning of the second file.
 
Old 06-27-2003, 08:38 AM   #8
dguy
Member
 
Registered: Dec 2001
Location: Beckwith Township, Ontario, Canada
Distribution: Slackware 14.0, Slackware-64 14.1
Posts: 119

Original Poster
Rep: Reputation: 16
Amanda

Quote:
Originally posted by bqh
Amanda does not require X nor does it have GUI.
It uses the native system dump or tar to back up
data, and has its own way of managing the index
database.
Yep, I've noticed.

A short time ago I was ready for a few trial runs of my first stab at an Amanda configuration, but the untimely death of a HDD put that on hold for a while.

Amanda, at least for me , has quite the learning curve to it. I was really hoping to get my hands on a well-commented sample set-up or two... haven't found one yet, but then I haven't looked in a while either.

-d.
 
Old 06-27-2003, 10:08 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,323

Rep: Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905
Well I finally tested your commands on my DLT and had similar results.

The only way I could restore the 2nd file from tape was to rewind and then fsf to the second file and then extract.

In summary:
tar -cvf /dev/nst0 /dir1
tar -cvf /dev/st0 /dir2
tar -xvf /dev/st0
mt -f /dev/nst0 fsf
tar -xvf /dev/st0
 
Old 07-14-2003, 10:57 PM   #10
x2000koh
Member
 
Registered: Jul 2002
Location: singapore
Distribution: red had 7.2
Posts: 109

Rep: Reputation: 15
Hi all
I need advise on how to do multi-volume archive on HP Superstore dat 24 (scsi tape)

My current backup script contains the following

tar cMpf nst0 server_path

The script is on cron job. The cron job is working fine, the problem is it doesn't prompt for to insert the second tape. Do i need to include the tape length or block size. Please advise.

Appreciate if anyone can help.

x2000koh
 
Old 07-14-2003, 11:30 PM   #11
bqh
LQ Newbie
 
Registered: Mar 2003
Posts: 19

Rep: Reputation: 0
I do not think tar can span tape.

That's the reason why everyone in Amanda group says you should divide your data into sub-sections so that tar can run them individually.
 
Old 07-23-2003, 02:23 PM   #12
SeanRinVA
LQ Newbie
 
Registered: Jul 2003
Location: Hampton, VA
Posts: 1

Rep: Reputation: 0
Backup Script help for a newbie

Hello,

I'm very new to scripting on Linux, so please bear with me. I need two directories backed up to tape every night (no diff or incr needed). I need this to run via cron every night. My understanding is that the script should look like this:

tar -cvf /dev/st0 /dir1 /dir2
mt -st -f /dev/st0 rewind

Is this all that is necessary? I want to make sure that directories within /dir1 and /dir2 are backed up as well. I also need the tar cmd to perform the verify. Finally, I'd like to set this up to run Monday through Friday at 0200. I simply do not know what to do next.

Thanks for your 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 11:55 AM
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 12:02 PM
.rpms, .tar.gz, .tgz, .src.rpm, & .tar.bz2 whoots Mandriva 10 10-18-2003 01:08 PM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 07:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration