[geeks] Linux tape backup help

Mark Benson md.benson at gmail.com
Thu Jan 14 05:23:29 CST 2010


I am working out a script to backup our new server to LTO3 tape and  
need some advice/scripting help.

Because our daily backup commit is not currently very large (about 5GB  
for a full backup, probably 2-300MB of changes a day at present, but  
this will get bigger as time goes on) I want to stack the backups made  
end-on on the tapes to extend the tape life and prevent wearing out  
one part of a very large tape.

As I am cycling tapes every day I am unsure how to persuade tar to  
append a new backup onto the tape rather than writing to the  
beginning. As the tapes are intended to be physically swapped daily  
(required for offsite data safety) I can't use /dev/nst0 as the tape  
must be rewound to remove it.

I also don't know as yet how to determine if space exists on a tape to  
complete an operation.

So I need to know 2 things:

1. How to append to a rewound tape.

2. How to determine the size of a backup (full and incremental) and of  
space exists on the tape to store it.

I intend to use 'tar' as the backup command and build scripts for cron  
to execute overnight. I am learning shell scripting as I go on and  
would consider something like parsing a log file or similar if required.

-- 
Mark Benson

http://markbenson.org/blog
http://twitter.com/MDBenson



More information about the geeks mailing list