View Single Post
Posts: 25 | Thanked: 8 times | Joined on Feb 2009 @ Venezia
#5
I am not (yet!) an N900 user, but I'm doing something similar with my N800 (so hopefully you can do the same on your device).
Here follows what needs to be done:
1) create a share on your network which contains the folder you want to sync with. Mine is a Linux only network, so I'm using NFS.
2) when your N900 connects to your wlan, mount the network share. This is tricky, but all you need to do is to place the proper script in folder "/etc/network/if-up.d" (a little googling will help);
3) run rsync with the proper flags. Beware that if your is a SAMBA (Windows) share, rsync need a special flag to work correctly.

Code:
#!/bin/sh

if [ "$METHOD" = loopback ]; then
	exit 0
fi

if [ "`iwgetid -as`" == "xx:xx:xx:xx:xx:xx" ]; then
  if [ "`ping -c 1 192.168.1.250 | grep "1 packets received"`" != "" ]; then
    mount -t nfs 192.168.1.250:/media/disk-1/ /media/edmini/disk-1/ >/dev/null 2>/dev/null
    mount -t nfs 192.168.1.250:/home/         /media/edmini/home/   >/dev/null 2>/dev/null
  fi
fi