Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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/

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .