Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup Question 2

Status
Not open for further replies.

cyoung

Programmer
Oct 31, 2001
188
US
I have installed a tape drive on a RedHat 8 server, and I am having problems with backing up multiple directories.

I want to be able to backup these directories without overwriting the previous set.

I am using tar in a script and calling it with cron, but if there is a better way, I would appreciate the info

Thanks!
 
You need to specify the 'no-rewind' version of your tape for each save, this will usually be found in the /dev or /dev/rmt directories and probably end with n, for example in Solaris the no-rewind device is usually /dev/rmt/0cn.

Basically, this leaves the tape at the end of the save without rewinding it, the latter being the default behaviour. HTH.
 

Use the device /dev/nst0

Cheers

Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Apologies - never used Linux, so didn't appreciate that the n would come at the beginning of the device name. Isn't standardisation wonderful!
 
Thanks all for the replies.

So, if I understand this, I would adjust my scripts to do the following:

1. Rewind the tape when the script starts,
2. tar each directory by using the /dev/nst0
3. verifiy the backups


Thanks agian for the help
 
Sounds about right. Be aware that verifying your backups can take an inordinate time. Possibly worthwhile if you have a test environment on which to do the verification, but an overhead on a live system. I assume you're aware of how to position the tape so that consecutive saves can be read?
 
Have you considered using "find" to create a list of files (fully qualified) to be used as tar's input stream? That way you wouldn't have to contend with the tape rewind/norewind issue and the entire operation would most likely be must faster. Here's an example:

find /usr/local/directory1 -print >tarlist
find /usr/opt/directory2 -print >>tarlist
find /etc/httpd -print >>tarlist

tar -cf/dev/st0 $(cat tarlist)

Try it - you might like it?

Bob
 
If you don't intend to overwrite your previous data, then do not rewind in your script.

"1. Rewind the tape when the script starts,"


>---------------------------------------Lawrence Feldman
SR. QA. Engineer SNAP Appliance
lfeldman@snapappliance.com

 
I have 7 tapes that I intend to use in a rotate scheme, so I will need to rewind.

I will try the find > cat option, as that make a lot more sense, and would make restores a lot easier.

Thanks all for the great tips and ideas
 
Bob,

I am testing your idea, but getting an error stating that the argument list is too long. Any ideas on how to work around this?

Thanks
 
Answered my own question (amazing what man can do.....)

tar -cf /dev/st0 -T /tmp/tarlist

Thanks again for all the tips!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top