zertrin / duplicity-backup.sh

Bash wrapper script for automated backups with duplicity supporting Amazon's S3 online storage as well as other storage destinations (ftp, rsync, sftp, local storage...).
https://zertrin.org/projects/duplicity-backup/
GNU General Public License v3.0
766 stars 187 forks source link

Feature Request: Only backup when connected to a whitelist of networks #178

Closed karlseguin closed 6 years ago

karlseguin commented 6 years ago

Don't run unless you're connected to a known network. I use this to make sure I'm not backing up on a public wifi, which can have limits.

Right now, I just put:

SSID=$(iwgetid -r)
if [[ $SSID != "HOME_SSID" ]]; then
  echo "Connected to unknown network: ${SSID}"
  exit 1;
fi

at the top of the script. But having this as a configurable list would be better.

zertrin commented 6 years ago

Hi, thanks for the suggestion but this is a really specific wish and I consider it out of scope for this project.

This is better suited for a wrapper script around calling duplicity-backup.sh like so:

#!/bin/bash

SSID=$(iwgetid -r)
if [[ $SSID != "HOME_SSID" ]]; then
  echo "Connected to unknown network: ${SSID}"
  exit 1;
fi

/path/to/duplicity-backup.sh -c /path/to/config_file
karlseguin commented 6 years ago

Ok. Thanks for considering. Maybe someone googling will find this issue and at least learn how to implement it themselves.