Links
Tags
apache
armenia
books
bsd
c
c++
chips
cinema
concurrency
cooking
database
dragonfly
erlang
filesystem
freebsd
fun
hardware
java
javascript
json
languages
linux
lyric
mac_osx
mail
math
misc
music
personal
poems
presentation
programming
python
references
ruby
rubyjs
scm
software
spiking_neural_net
study
sysadm
sysarch
technology
testing
travel
virtualization
web
wee
windows
How to copy the files of a hard-disk from one computer to another, across a
network, without loosing file attributes? That’s kind of easy using
pax and ssh (pax is probably only available on
BSD. cpio on others will do fine, too):
cd directory/to/copy
pax -w -x sv4crc . |
ssh root@remotehost "cd directory/to/copy/into && pax -r -p e"
You should use "root", to maintain correct ownership of files. Use format sv4crc, as most other formats are limited to a path-length of 255.
To double-check that all files were transfered correctly, make use of mtree:
cd directory/to/copy
mtree -c -k md5digest -p . |
ssh root@remotehost "cd directory/to/copy/into && mtree -k md5digest -p ."
If there’s no output, everything is OKAY!