Tuesday, March 23, 2010

Nokia N900 guide: Sync folders between N900 and PC over wifi (by authorized users only)

In the previous post, I talked about how to use rsync to sync the DCIM folder on the N900. This post will build on that same design and extend it to sync an additional folder by an authorized user only.

First, let's expand /etc/rsyncd.conf. We are going to add another module called "top_secret" and only "santa" can have access to it.

/etc/rsyncd.conf

max connections = 3

[camera]
path = /home/user/MyDocs/DCIM
uid = nobody
gid = 65534

[top_secret]
path = /home/user/MyDocs/.videos
auth users = santa
secrets file = /etc/rsyncd.secrets
Next, create /etc/rsyncd.secrets on the N900 with the following content.
santa:claus
  • (Authorized user is "santa" with password "claus".)

Now go back to Windows and update sync_n900.bat:
set RSYNC="C:\Program Files\cwRsync\bin\rsync"

%RSYNC% -aP santa@192.168.0.105::top_secret "/cygdrive/C/Documents and Settings/N900 User/My Documents/My Pictures/Another N900 Folder"

%RSYNC% -az --progress 192.168.0.105::camera "/cygdrive/C/Documents and Settings/N900 User/My Documents/My Pictures/From N900 Camera"
  • In case you haven't noticed, the arguments for the two rsync commands are slightly different. The "P" switch allows partially transferred file to be saved even if the rsync connection is terminated abruptly. rsync will automatically pick it up where it left off the next time you sync again. This is especially useful for transferring very large files.
  • Upon running sync_n900.bat, you will be prompted to enter password for user "santa".
  • And that's it! Now you can rsync multiple folders!

No comments: