[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.
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
howtos:general_admin:files_filesystem_copying_over_network [2013/02/10 12:12 (UTC)] – created wisedraco | howtos:general_admin:files_filesystem_copying_over_network [2013/02/10 16:59 (UTC)] – [Sources] Removed the template tag / added more tags sycamorex | ||
---|---|---|---|
Line 1: | Line 1: | ||
<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | ||
====== How to copy files \ directories | ====== How to copy files \ directories | ||
- | That small article | + | The article |
- | I want do this on my homeserver upgrade, copy all info from working " | + | |
- | In examples, i work from " | + | |
- | " | + | |
- | ====== Files \ single folder copying ====== | + | When upgrading |
- | If you need a copy of standalone files or folders, you can use an scp util: | + | * New server (IP: 192.168.0.14) |
- | '' | + | * Old server (IP: 192.168.0.1) |
- | There -r key do recursively, | + | |
- | -p key preserve file attributes, like a creation, modification times | + | |
- | -v gives us verbose output. | + | |
- | in there example we copy " | + | |
- | Sadly, but that command | + | Both the '' |
- | Thanks to Patrick, " | ||
- | ====== Copy whole filesystem ====== | ||
- | command | + | ====== Copy Files / Directories ====== |
+ | If you need to copy single files or directories, | ||
- | '' | + | < |
+ | scp -r -v -p root@192.168.0.1:/ | ||
+ | </ | ||
+ | |||
+ | Flag explanation: | ||
+ | * -r: recursive (copy all the content of '' | ||
+ | * -p: preserve file attributes (eg. file creation or modification times) | ||
+ | * -v: verbose output | ||
+ | |||
+ | In the example above we copy the ''/ | ||
+ | |||
+ | Please note that the '' | ||
+ | |||
+ | ====== Copy whole filesystem hierarchy ====== | ||
+ | |||
+ | The following command should successfully copy a whole filesystem hierarchy: | ||
+ | <code bash> | ||
+ | ssh root@192.168.0.1 "(cd / ; tar cf - . )" | (mkdir -p /local_dir | ||
+ | </ | ||
- | help us transfer full filesystems without stuck and pain from " | ||
Line 36: | Line 45: | ||
<!-- * Originally written by [[wiki: | <!-- * Originally written by [[wiki: | ||
<!-- * Contributions by [[wiki: | <!-- * Contributions by [[wiki: | ||
- | * Originally written by[[wiki: | + | |
- | * With help from Patrick Volkerding | + | * With help from Patrick Volkerding |
<!-- 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 " | <!-- You must remove the tag-word " | ||
- | {{tag> | + | {{tag> |