Painless Facebook development with rsync

Lately I’ve been involved in developing applications for the Facebook Platform. The Facebook API is great, but the documentation is very out of date. The new Graph API seems to simplify a lot of things, and is very well documented in comparison to the old REST API. However testing your apps locally is still very annoying.

After long sessions of FTP uploading a friend of mine recommended rsync to me and my life has been much better since then. Rsync is a software for UNIX to synchronizes files and directories. With rsync and the help of SSH you can sinchronize both your local and remote directories in no time, leveraging the time it takes for you to watch the changes.

Just add this line of code to your bash profile and you are ready to go.

alias sync_fb='rsync -zrptL --delete-after -e "ssh" --exclude=.DS_Store --exclude=.git --cvs-exclude local_directory_path username@domain:remote_directory_path'

Just type sync_fb on your Terminal and you’ll se how the changes reflect on your remote directory in no time. Of course you can change the name of the task and create as many tasks as you want. The –exclude=.DS_Store and –exclude=.git parameters are for mac and git users. If you are not a mac or git user, you can delete those. Also if you have public SSH keys set, you won’t even notice you are “pushing” to a remote directory.

For Textmate users there’s a bundle written by Joshua Priddle, which let’s you synch your directories with a simple keyboard shortcut.  You can read more about it here. I tested it and I think it’s great. Not only it has all the benefits of rsync, but it also nicely outputs errors and a list of synched files in a new file.

This entry was posted in UNIX and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

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