CPIO command to backup and restore in Linux
|
|
|
Comments (8)
Dumb question time.
Why not use SFTP (or FTP if it was trusted) to transfer the archives, and just run cpio locally? In my experience, even network tar/gzip pipes is more efficient than NFS for bulk transfers.
EDIT: Fixed semantic error.
Why not use SFTP (or FTP if it was trusted) to transfer the archives, and just run cpio locally? In my experience, even network tar/gzip pipes is more efficient than NFS for bulk transfers.
EDIT: Fixed semantic error.
@gus3: We tried it and on the network in question cpio proved to be faster. Obviously, YMMV. Their network had, um... interesting issues that may have played a part. In any case, even locally, cpio is faster than tar.
Apparently, I didn't fix enough of the semantic error to be clear. Seems to be a habit lately.
My impression from your first comment, is that you had an NFS mount, and were running cpio on the NFS client, while the files you unpacked were sent via NFS to the server.
What I'm wondering is, why you didn't use a streaming (not datagram) protocol to transfer the archive to the server, then run cpio directly on the server?
My impression from your first comment, is that you had an NFS mount, and were running cpio on the NFS client, while the files you unpacked were sent via NFS to the server.
What I'm wondering is, why you didn't use a streaming (not datagram) protocol to transfer the archive to the server, then run cpio directly on the server?
I think I was the one who didn't communicate clearly. We tried what you suggest. It wasn't faster in their environment. There were a lot of issues with that network which might have contributed to that result but the fact is that using cpio across an NFS mount worked better.
What advantages does this method have over using rsync?
Rsync uses TCP. The dodgy network in question apparently deals better with datagram transmission than with streams.
@Steven: In addition to the issues regarding transmission of large arcives that gus3 and I have been discussing there is the issue of creating the archive itself. cpio is much faster than tar as I mentioned before. The combination of the two speed improvements made the choice a no-brainer.
Oh, and the script to do this was two lines long: one to do the archive, transfer, and unarchive and the second to send a notification that the process was completed.
Oh, and the script to do this was two lines long: one to do the archive, transfer, and unarchive and the second to send a notification that the process was completed.
Post a comment
A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.
Your message:Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help
Sign up and post (it is free) or Log in and post

cpio has been around in *nix forever. It's a pity more people don't know about it and use it. I'm amazed how many sysadmins I've talked to who just never tried using cpio.