LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   backup of multiple Directories in different volumes (https://www.linuxquestions.org/questions/linux-server-73/backup-of-multiple-directories-in-different-volumes-587450/)

Sagar Biswas 09-26-2007 05:08 AM

backup of multiple Directories in different volumes
 
Hi,

I have a LTO 200GB TAPE.
I am using 'tar' command to take backup,but facing problem, taking backup of multiple volumes.

I have different volumes as
/appl ->32 GB
/data ->64 GB
/log ->2 GB

I want to take of these multiple volumes in a same Tape Cartridge.
But no in a single time.I need the option of taking backup of /appl in one time, /data & /log at another time ...

Please help me.
Thanks
Regards
sagb

dgar 09-26-2007 07:58 AM

The "trick" here is understanding the different tape device files:
/dev/st0
/dev/nst0

The second file is the 'non-rewinding' device. If you write to it, the tape does not automatically auto-rewind, allowing multiple archives to the same tape.

Once you go /dev/nst0, stick with it!

To move around the tape, use the 'mt' command, and REMEMBER TO ALWAYS USE nst:

mt -f /dev/nst0 fsf 1 # move forward one archive

mt -f /dev/nst0 asf 2 # rewind and forward to archive 2 regardless of current position

mt -f /dev/nst0 rew # rewind to beginning of tape

mt -f /dev/nst0 status # report where the hell on the tape you are. :)

If you slip up and use '/dev/st0' on any of the above commands, it will rewind to the beginning after completion!!!

petcherd 11-09-2007 06:05 PM

Sorry for jumping-in so late, but I was looking for the answer to a different problem of my own and I've used a different approach to this issue. I record all the data in a single GNU tar session thus:
Code:

#!/bin/sh
#initialize an empty file to make my queue
: > /tmp/joblist.txt
echo "/appl" >>/tmp/joblist.txt
echo "/data" >>/tmp/joblist.txt
echo "/log" >>/tmp/joblist.txt
echo "These directories will be tar-ed:"
cat /tmp/joblist.txt
#write the files
tar --create --filesfrom=/tmp/joblist.txt --file /dev/nst0

This approach gives me a chance to string together all sorts of files that might have been related. One could build the joblist file with all sorts of complex conditional statements and/or string hacking if one had the need to do so.


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