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.

  1. rsync -vur --delete --exclude=*.db --exclude=*.info /mnt/photos/ /home/jgill/photos/
rsync -vur --delete --exclude=*.db --exclude=*.info /mnt/photos/ /home/jgill/photos/
Short URL: Generating...

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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" extra="">