The script in this post handles synchronization of files and folders. You can specify source and destination file. It's using timestamp of file and md5 sum to check if the file was modified.
I've created this script because I needed to sync several files/folders with owncloud folder.