[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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:general_admin:files_filesystem_copying_over_network [2013/02/10 16:29 (UTC)] – [How to copy files \ directories \ filesystems via network.] sycamorexhowtos:general_admin:files_filesystem_copying_over_network [2013/02/10 17:00 (UTC)] (current) – [Copy Files / Directories] sycamorex
Line 11: Line 11:
  
  
-====== Files \ single folder copying ====== +====== Copy Files / Directories ====== 
- If you need copy of standalone files or folders, you can use an scp util:\\ +If you need to copy single files or directories, you can use the ''scp'' command:\\ 
  
-''scp -r -v -p root@192.168.0.1:/etc /From_Old_Server'' \\ +<code> 
- +scp -r -v -p root@192.168.0.1:/etc /local_dir 
-There: +</code>
-  *  -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).\\ +Flag explanation: 
 +  *  -r: recursive (copy all the content of ''/etc'' including its subdirectories) 
 +  *  -p: preserve file attributes (egfile creation or modification times) 
 +  *  -v: verbose output
  
-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.\\ +In the example above we copy the ''/etc'' directory located on a remote host (the old server: 192.168.0.1to ''/local_dir'' on the local host ("newserver)
  
-Thanks to Patrick"Volkerdi" gives us workaround for that situation:+Please note that the ''scp'' command cannot copy the whole file system hierarchy including ''/proc''''/dev'' or ''/lost+found''. Fortunately, there is a workaround which was [[http://www.linuxquestions.org/questions/slackware-14/copy-whole-filesystem-via-scp-4175449321/#post4887869|provided]] by Patrick Volkerding.
  
-====== Copy whole filesystem ======+====== Copy whole filesystem hierarchy ======
  
-command +The following command should successfully copy a whole filesystem hierarchy: 
 <code bash> <code bash>
-ssh root@192.168.0.1 "(cd / ; tar cf - . )" | (mkdir -p /From_Old_Server ; cd /From_Old_Server ; umask 000 ; tar xvf -)+ssh root@192.168.0.1 "(cd / ; tar cf - . )" | (mkdir -p /local_dir ; cd /local_dir ; umask 000 ; tar xvf -)
 </code> </code>
  
-help us transfer full filesystems without stuck and pain from "old" to "new" computer. 
  
  
Line 51: Line 50:
 <!-- Please do not modify anything below, except adding new tags.--> <!-- Please do not modify anything below, except adding new tags.-->
 <!-- You must remove the tag-word "template" below before saving your new page --> <!-- You must remove the tag-word "template" below before saving your new page -->
-{{tag>howtos template}}+{{tag>howtos copy ssh}}
 howtos:general_admin:files_filesystem_copying_over_network ()