Tuesday, June 22, 2010

Synchronize windows & linux folders using samba and rsync

I've been trying all night long to synchronize two folders. The source was a shared Windows NTFS partition and the destination a local folder on Ubuntu. After numerous re-tries did it.

First I had to mount the NTFS partition


sudo smbmount //REMOTE_IP_ADDRESS/SHARED_FOLDER /LOCAL_FOLDER -o username=REMOTE_USER,password=REMOTE_USER_PASSWORD,iocharset=utf8,file_mode=0777,dir_mode=0777

Afterwards I run rsync as if the two folders were local. There is also a handy GUI version for rsync, grsync.

When you finish don't forget to unmount it

sudo smbumount /LOCAL_FOLDER