Restic has been fantastic for backing up my MacBook: it’s super reliable, fast, and uses minimal resources. So, first of all, THANK YOU to all the developer for your hard work to creating such a great tool.
One of the issues I’ve experienced is when I go outside with my laptop and connect to the internet using my mobile data personal hotspot, if restic is running it can quickly consume all my mobile data in a few minutes, leaving me stuck and offline.
I have partially solved this problem by creating a wrapper for restic that checks if I’m connected to mobile hotspot before beginning any operation, and if so, it won’t start any new back up, prune, check, etc. However, one thing I can’t solve through this method is pausing an operation that has already begun before I leave my house. E.g., today, restic check
was running when I closed my laptop and left the house; when I connected to mobile hotspot the check
operation continued and used the remaining 12GB of data in my mobile plan in a few minutes (which costs about 500 pesos here, ≈ €26).
Testing if a macOS computer is using a mobile hotspot is fairly simple: just test if any network interface has been assigned a 172.20.10.0/24
IP address. You can see how my shell script does this test here. I understand that this is not a cross-platform solution, but perhaps somebody has some ideas for making it work and useful for other platforms too? This is a common feature for consumer-grade back up software, so it’s not unreasonable that restic should include it too.
I know I can solve this in other ways, e.g., by using a firewall to block some network connections depending on which interface is in use. Little Snitch can do this well, and I used it for many years, but it just had too much cognitive overhead and I’m happier not to be using it. If there were a simple CLI technique that achieves the same it would be a good option, especially if I could integrate it into my wrapper script, although I have some hesitation towards modifying the system, because it adds one more task when doing a system reinstall.