directory Syncing

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
Slet denne besked
Besvar denne besked
Skribent: sinck@ugive.comsinckugive.com
Dato:  
Emne: directory Syncing
\_ #!/bin/bash
\_ #
\_ CURRENTDIR=`pwd`
\_ cd $2
\_ TARGETDIR=`pwd`
\_ cd $CURRENTDIR
\_ cd $1
\_ shift
\_ shift
\_ # allow passing of arguements to the extracting tar, such as keep
\_ existing files, etc
\_ tar -cvf - * | tar $@ -xvC $TARGETDIR -f -

that's cooler than the

tar -cf - | (cd destdir; tar -xvf -)

one that I've used in similar circumstances

David