Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.