Wayne Davison wrote:

On Wed, Jan 26, 2005 at 10:28:46AM -0800, Jon Drukman wrote:


And I want it to arrive on the remote machine at:

/other/foreign/directory/file.zip

But only /other exists, is there any way to have rsync create the intermediate directories?



Solution #1 (uses -R):

   cd /scratch-dir
   mkdir foreign
   ln -s /some/local/path foreign/directory
   rsync -avR --no-implied-dirs foreign/directory/file.zip host:/other
   rm -rf foreign

That causes rsync to duplicate the relative path dirs as dirs instead of
making the last one a symlink.

Solution #2 (sends the dirs separately):

   cd /scratch-dir
   mkdir -p foreign/directory
   rsync -av foreign host:/other
   rsync -av /some/local/path/file.zip host:/other/foreign/directory
   rm -rf foreign

Solution #3 (makes the dirs without using rsync):

   ssh host mkdir -p /other/foreign/directory
   rsync -av /some/local/path/file.zip host:/other/foreign/directory

..wayne..


thanks wayne, i've been doing solution #3 all along, guess i'll stick with it. thanks!

-jsd-

--
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to