LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Problem: tar Backup to Remote Tape Drive (https://www.linuxquestions.org/questions/linux-software-2/problem-tar-backup-to-remote-tape-drive-655939/)

HaroldWho 07-15-2008 12:56 PM

Problem: tar Backup to Remote Tape Drive
 
I want to use tar to back up one box that is connected wirelessly to a second one equipped with a DAT drive. I need to be root to do the full backup, because only root can read some directories.

I have been unsuccessful in using tar's built-in 'rsh' facility, because rsh will not accept root connections. I can do a root login with ssh, but the command:

tar --rsh-command=ssh --file=localnetwork.net:/dev/nst0 -cv /

fails.

I could just use NFS to mount the whole fs, but I still think there's a way to do it remotely with tar.

Insights

HaroldWho

TB0ne 07-15-2008 01:36 PM

Quote:

Originally Posted by HaroldWho (Post 3215433)
I want to use tar to back up one box that is connected wirelessly to a second one equipped with a DAT drive. I need to be root to do the full backup, because only root can read some directories.

I have been unsuccessful in using tar's built-in 'rsh' facility, because rsh will not accept root connections. I can do a root login with ssh, but the command:

tar --rsh-command=ssh --file=localnetwork.net:/dev/nst0 -cv /

fails.

I could just use NFS to mount the whole fs, but I still think there's a way to do it remotely with tar.

Never tried to do this, but a lowball way might be to tar everything up, and ship that file over to the other machine, where you write it to tape.

You might also want to try:

tar -cv / | scp <userid>@<remote machine address>:/dev/nst0

Which may prompt you for a password, then use SCP to 'copy' the data to the destination (in this case, the tape drive).

Might work..as I said, just an idea. Never tried it.

H_TeXMeX_H 07-15-2008 02:58 PM

This program may be able to help:
http://www.maier-komor.de/mbuffer.html

Code:

      Making a backup via network:

      tape server: mbuffer -I 8000 -f -o $TAPE

      backup client: tar zcf - /home | mbuffer -O tapeserver:8000

And if you use the right options it will prevent extra wear on the tape motors.

choogendyk 07-16-2008 09:30 AM

I have done backups to a drive on another server. The method works well, is secure, and would transfer to what you want. I used ufsdump and dd. You could use tar and dd. Details posted in this thread: http://www.linuxquestions.org/questi...loader-655067/

HaroldWho 07-16-2008 02:37 PM

Thanks to you all. I will certainly follow up on the 'scp' suggestion, even I can understand it :-)

The 'code' quote in the 'mbuffer' suggestion is a little too cryptic for me, but I d/l'd mbuffer and will read further.

I did enable an NFS mount of the box to be backed up, and just backed up the mounted fs on the tape locally. Works fine, but there's some speed penalty for the network fs access. OTOH, I havent experimented with NFS server options yet.

Thanks again,

HW

TB0ne 07-16-2008 03:27 PM

Quote:

Originally Posted by HaroldWho (Post 3216764)
Thanks to you all. I will certainly follow up on the 'scp' suggestion, even I can understand it :-)

The 'code' quote in the 'mbuffer' suggestion is a little too cryptic for me, but I d/l'd mbuffer and will read further.

I did enable an NFS mount of the box to be backed up, and just backed up the mounted fs on the tape locally. Works fine, but there's some speed penalty for the network fs access. OTOH, I havent experimented with NFS server options yet.

Thanks again,

HW

Well, I'd go with the mbuffer (never knew that existed, but would have suggested it had I did...good call) program. SCP is a bit clunky for what you want to do...very lowball, and may not even work.

HaroldWho 07-17-2008 01:20 PM

Further to the suggestions:

As far as I can tell, 'scp' doesn't accept input on STDIN.

Having untarred and compiled 'mbuffer' and RTFM, that looks like what I need (and I never heard of it before either). Haven't tested it yet, but hope springs eternal :-)

Thanks again,

HW

H_TeXMeX_H 07-17-2008 02:13 PM

I haven't ever heard of mbuffer either, but I found it a few days ago while searching for something else entirely, dunno if it will do what you want, but it might.

HaroldWho 07-30-2008 12:05 PM

Final Word: 'tar' Backup to Remote Tape Drive
 
I did a little evaluation of 'mbuffer' as suggested. It works, it's neat, it's even reasonably fast (after a few tweaks to buffer size and the tape block size). It still leaves one issue unaddressed: how to run a 'verify' (tar -d) on the finished tape.

So, I'm using NFS to mount the filesystem tree r/o on the box with the tape drive, and backing up the entire mount. Maybe a little slower (ca 480 kB/s, vs ca 500 with mbuffer), but running 'verify' is a no-brainer, and a script automates the whole thing to be unattended.

Again, sincere thanks to everyone who contributed.

HaroldWho


All times are GMT -5. The time now is 03:42 AM.