I just publish a short little script here for anybody who needs from time to time to use a metered connection like the hotspot of his mobile phone. This script will disable urbackupclient temporarly. We just had an other blackout and urbackupclient on my laptop ate all my mobile data in less than 15 minutes.
It works on debian, but I guess it should work on most other distributions, too.
Copy following script into /etc/network/if-up.d/ and give it a name like “urbackclient”, and “chmod +x” - it:
#!/bin/bash
ssid=$(iwgetid -r)
if [ "$ssid" == "WLAN-Network-Name" ]; then
systemctl stop urbackupclientbackend
elif ! systemctl is-active urbackupclientbackend > /dev/null ; then
systemctl start urbackupclientbackend
fi
Replace WLAN-Network-Name with the ssid of the wlan over which you don’t want to do backups. The script will also restart urbackupclient when on any other connection (should also work when you connect to an ethernet connection, but I can’t test it). It also works when you use Network-Manager.
I know it’s a ridiculously short script. But maybe it helps somebody else. It took me 25 minutes (including finding out where to put it) to write it. I still remember how to do comparisons and conditional jumps in assembler on Sparc architecture, but when ever I have to do it in Bash (or any other shell) it takes me forever to get it working…