[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

This is an old revision of the document!


How to copy files \ directories \ filesystems via network.

That small article give a view of content copying task via network.
I want do this on my homeserver upgrade, copy all info from working “old” server, to “new” server partition, for can make access a data and config files, for bring “new” server in state it looks be similar of “old” one, before switch “old” off, and set “new” instead it.
In examples, i work from “new” server CLI, it has IP 192.168.0.14
“Old” server has IP 192.168.0.1, both in in one subnet.
Both, “ssh” and “scp” commands work via secure shell ( ssh ) protocol, port 22, and must be enabled “sshd” on computer where we connect.

Files \ single folder copying

If you need a copy of standalone files or folders, you can use an scp util:

scp -r -v -p root@192.168.0.1:/etc /From_Old_Server

There:

  • -r key do recursive , copy all data in “/etc” folder and all its subfolders.
  • -p key preserve file attributes, like a creation, modification times.
  • -v gives us verbose output.

In there example we copy “/etc” folder from 192.168.0.1 computer ( actually, “Old” server), to folder “/From_Old_Server” in local computer ( “new” server).

Sadly, but that command ( scp ) cannot copy whole system disk, contains “/proc”, “/dev” and even “/lost+found” catalog, who is it in every mounted extX filesystem partition - at that places “scp” stuck and stops.

Thanks to Patrick, “Volkerdi” gives us workaround for that situation:

Copy whole filesystem

command

ssh root@192.168.0.1 “(cd / ; tar cf - . )” | (mkdir -p /From_Old_Server ; cd /From_Old_Server ; umask 000 ; tar xvf -)

help us transfer full filesystems without stuck and pain from “old” to “new” computer.

Sources

* Originally written by John Ciemgals 2013/02/10 03:51
* With help from Patrick Volkerding

 howtos:general_admin:files_filesystem_copying_over_network ()