fevangelou
6/13/2014 - 2:36 PM

Easy-peasy folder sync on a Mac

Easy-peasy folder sync on a Mac

#!/bin/bash

# USAGE:
# Save this file as whatever.command and make sure this file is executable.
# To make it executable, simply open up your Mac's terminal, cd to the folder
# where you've saved this file and then run: $ chmod +x whatever.command
# 
# To execute the file, save it in your Desktop or Home folder and simply click on
# it whenever you want to sync these folders. Alternatively you could create a cron
# job to do this automatically for you.
# 
# To sync multiple folders, simply copy paste the rsync line
# and change source and target folders.

# Example: sync my GitHub template repo to 2 local websites for mult-site testing
# Notice the changed path in the second line below...
rsync -av --delete ~/Projects/GitHub/myTemplate/ ~/WWW/site/templates/myTemplate/
rsync -av --delete ~/Projects/GitHub/myTemplate/ ~/WWW/site/templates/myTemplate/