Yes, you can rsync between two local directories

I wanted to set up a cronjob to backup my photos from a Windows computer to my linux server. To do so I simply set Windows to share the photos directory, then mounted the directory in linux.

The rsync command seemed like the most logical way to sync the mounted directory with my backup directory. However, every piece of documentation I could find online showed examples of rsync communicating with an external server. I’m here to tell you that’s not entirely necessary and setting it up to synchronize 2 local directories works just as well.

rsync -vur --delete --exclude=*.db --exclude=*.info /mnt/photos/ /home/jgill/photos/

Bookmark and Share

6 Responses  |  add yours »

6 Responses to “Yes, you can rsync between two local directories”

  1. bagheera says:

    Thanks for the tip. For some reason I needed to add a fuzzy (y) option to stop it from transferring everything. Can rsync handle files that have been renamed at the source? I now have both files at my destination (original and renamed).

  2. Useful, in searching Google for this your site was the most useful.

    Although I did use a few more switches to preserve permissions and group/user but overall your post was very useful.

    Thank you.

  3. andrea says:

    you can still use the client/server systrem using DeltaCopy on the windows machine:
    http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp

  4. Great Job!
    I Use it today and see the results is Cool.
    Thanks.

  5. JP - DB says:

    It may seem obvious but when rsyncing subversion directories, remember to use “–exclude=*.svn”

  6. Kagemaru says:

    @bagheera: Isn’t that what the -c option does? skips based on checksums?

Leave a Reply

(if you want a pic to show with your comment, go get a gravatar!)

Search