Rsync basic question

Matt McCutchen hashproduct+rsync at gmail.com
Sat Oct 21 03:18:10 GMT 2006


On 10/20/06, Michael Homscheidt <Michael.Homscheidt at web.de> wrote:
> - If I get the data back from the module the directory /Applications/
> Scripts/Applications/Scripts is created.
> [...] (server to client) rsync --relative --recursive  --archive --
> compress --stats --perms --times $MODULE  $DIRECTORY
>     where $ DIRECTORY is /Applications/Skripte an $MODULE is the
> configured module

Your current client-to-server command sends /Applications/Scripts on
the client to a /Applications/Scripts subdirectory inside the module
because you used --relative, which recreates the path of the source
inside the destination.  Your server-to-client command copies the
entire module to $DIRECTORY; since the module contains a subdirectory
/Applications/Scripts, naturally rsync creates a corresponding
subdirectory inside $DIRECTORY.

If you meant to send /Applications/Scripts to the root of the module,
remove --relative from the client-to-server command.

Otherwise, you want to download the /Applications/Scripts subdirectory
of the module instead of the entire module, which means the source in
the server-to-client command should be $MODULE/Applications/Scripts/
instead of $MODULE .  Furthermore, --relative will recreate the
Applications/Scripts path info from the source inside $DIRECTORY,
which will give you the same problem, so remove --relative from the
server-to-client command.  The resulting command would be:
    rsync --archive --compress --stats $MODULE/Applications/Scripts/ $DIRECTORY
(I left off --recursive, --perms, and --times because they're included
in --archive.)

Matt


More information about the rsync mailing list