Rsync when connected to specific wifi, linux

1

I want to do actions when connected to a specific network. One of those things is rsync to a client/server on the network.

How can i do it? I'm guessing ACPI but i don't know anything for a SPECIFIC network, just network type. So basically it should be possible to run a script on a certain event/trigger or just run a script on connect to network/wifi and then do a check for the SSID.

I'm running arch linux x64.

In short: how can I rsync when connected to home wifi under linux?

Gunnish

Posted 2013-02-16T14:38:23.577

Reputation: 219

Answers

0

If you want to actually trigger the script as soon as you connect it would first be important to know which daemon you use to connect to the wifi? some like wpa_supplicant?

In the case of wpa_supplicant, you could add a hook into this script: /etc/wpa_supplicant/wpa_cli.sh

Otherwise, a generic solution would be to create a cronjob which is running like once an hour, or every 10min, and checks the currently active SSID on the interface. If the SSID is the one that you want to rsync, then it could call your job. This script could also record somehow when it ran last time, and keep some minimum time between multiple runs.

replay

Posted 2013-02-16T14:38:23.577

Reputation: 474