TAR OVER SSH

Hello,

I have a server that has a tape drive attached to it in our company's DMZ. I want to backup the data on other servers onto this tape drive using a script. I will have to ssh into each machine and execute a tar command and instruct the tar command to send the data back to the server that has the tape drive to record the information on the tape drive.

Can someone tell me the commands to go about doing this? I have done some research on the net but I only found an example where the script is being run on the server with the backup data and it did not have a tape drive.

Just an idea of tarring over ssh:

ssh user@srcbox 'tar cf - srcpath' | tar xf - trgt

this uses " - " for "f" to signify stdin/stdout for tar.

Why do you say tar xf -?

I want to send ti to tape....how can I do that?

That depends on your platform and the name of your tape device.

What is the name of your tape device?

Normally, people use the cpio command to send data to a tape device, BTW.

It is called /dev/nst0

tar has no capability send to a remote server unless you could export the tape device using NFS (for example) and mount this on the machine you are backing up. However, you cannot do this because NFS does not support exporting tape devices.

So, you could NFS mount a directory on the server with the tape device. Then when you use SSH to run your tar backup, you write the output of tar to the server in the DMZ with the tape device.

Then, you could write another script to instruct the server with the tape device to write the backup file to tape.

Or, you could simply NFS export the file system you want to backup to the server with the tape drive, and then run the tar backup command directly on that server where you have mounted the exported filesystem.