[clug] rsync - how to create path on remote server

Andrew Janke a.janke at gmail.com
Fri Jun 15 00:22:52 GMT 2007


If I can grok what you are after correctly will not this do what you want:

   rsync -zav -R /A/B/C/D remotehost::Share/A

?  This will create remotehost::Share/A/A/B/C/D

a

On 6/15/07, Peter Barker <pbarker at barker.dropbear.id.au> wrote:
> On Fri, 15 Jun 2007, Stephen Hodgman wrote:
>
> > know if the the complete remote path exists.
> > e.g. My path is /A/B/C/D/ and I need to put this under the remote server tree
> > /A etc
> > However, if for example the "C" directory does not pre-exist on the remote
> > server my command
> > rsync -zav /A/B/C/D remotehost::Share/A/B/C
> > will not work.  If the "C" folder does exist it will.  How do I get rsync to
> > "auto create"  the "C" folder?
>
> I can't see any way of getting rsync to do that directly.  OTOH, you
> could try:
>
> mkdir $TMP/empty
> for i in A A/B A/B/C; do
>   rsync -a $TMP/empty remotehost::Share/$i
> done
> rsync -zav /A/B/C/D remotehost::Share/A/B/C
> rmdir $TMP/empty
>
> > Stephen Hodgman
>
> Yours,
> --
> Peter Barker                          |   Programmer,Sysadmin,Geek.
> pbarker at barker.dropbear.id.au         |   You need a bigger hammer.
> :: It's a hack! Expect underscores! - Nigel Williams
> --
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux
>


-- 
Andrew Janke   (a.janke at gmail.com || http://a.janke.googlepages.com/)
Canberra->Australia    +61 (402) 700 883


More information about the linux mailing list