User Tools

Site Tools


2019:01:01:using-tar-to-duplicate-directories-between-servers

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
2019:01:01:using-tar-to-duplicate-directories-between-servers [2019/01/01 23:25]
Louis T. Getterman IV [Introduction]
2019:01:01:using-tar-to-duplicate-directories-between-servers [2019/07/12 12:25] (current)
Louis T. Getterman IV [Implementation]
Line 34: Line 34:
 ====== Implementation ====== ====== Implementation ======
 So, this is where [[wp>tar (computing)|tar]] over [[wp>​SSH]] comes into play!  The following will yield the desired results, albeit employing a different technique: So, this is where [[wp>tar (computing)|tar]] over [[wp>​SSH]] comes into play!  The following will yield the desired results, albeit employing a different technique:
 +
 +<WRAP center round tip 60%>
 +Please note: if you're not interested in retaining file & group ownership, you can use this line instead:
 +
 +<code bash>
 +"mkdir -pv '​${dPath}'​ && cd '​${dPath}'​ && tar -xzvf - . && chown -Rv ${dUser}: ."
 +</​code>​
 +</​WRAP>​
  
 <code bash> <code bash>
Line 50: Line 58:
  ssh \  ssh \
  "​${dUser}@${dHost}"​ \  "​${dUser}@${dHost}"​ \
- "​mkdir -pv '​${dPath}'​ && cd '​${dPath}'​ && tar -xzvf - . && chown -Rv ${dUser}: ​." \+ "​mkdir -pv '​${dPath}'​ && cd '​${dPath}'​ && tar -xzvf - ." \
  ;  ;
 </​code>​ </​code>​
2019/01/01/using-tar-to-duplicate-directories-between-servers.txt · Last modified: 2019/07/12 12:25 by Louis T. Getterman IV