rsync --delete (but not all files) question - Tools

This is a discussion on rsync --delete (but not all files) question - Tools ; Hi all, getting started with rsync. One of the best utilities I've used! My question is: I am syncing from my local web development directory (/var/www/mysite) to another drive shared by our dev team. The copy I am syncing to ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: rsync --delete (but not all files) question

  1. rsync --delete (but not all files) question


    Hi all,

    getting started with rsync. One of the best utilities I've used! My
    question is:

    I am syncing from my local web development directory (/var/www/mysite) to
    another drive shared by our dev team. The copy I am syncing to is a local
    subversion repository, and thus contains .svn directories.

    So I want to sync from the dev directory (which doesn't have .svn
    directories) to one that does. However, I want to use the --delete option
    for all files and directories *other* than these .svn directories. I want
    to keep the .svn directories as is, but otherwise sync the two directories
    exactly, erasing files that no longer appear in the source directory.

    I am also using an --exclude-from file to remove emacs (~) backup files and
    such things.

    I have something like:

    rsync -va --delete --exclude-from=$EXCLUDES_FILE --stats /var/www/mysite
    remoteDirectory

    I'm not sure how to use --delete and still keep certain files / dirs (those
    ..svn dirs).

    Any help would be appreciate.

    Thanks,
    GMF.

    --
    View this message in context: http://www.nabble.com/rsync---delete...p17751838.html
    Sent from the Samba - rsync mailing list archive at Nabble.com.

    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  2. Re: rsync --delete (but not all files) question

    On Tue, Jun 10, 2008 at 03:03:23AM -0700, GiveMF wrote:
    > So I want to sync from the dev directory (which doesn't have .svn
    > directories) to one that does.


    An exclude does two things: it prevents files that match from being
    transferred from the sender, and it protects files that match from being
    deleted on the receiver. You can also specify those two actions
    separately using a filter rule. In your case, the easiest thing to do
    is just to add "- .svn/" into your excludes so that all .svn directories
    are excluded.

    ...wayne..
    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    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 to Thread