Backup does not start on metered connections anymore

This commit is contained in:
Bruno F. Fontes 2021-02-23 08:58:09 -03:00
parent 7a28fde055
commit 2b36d7c555
Signed by: brunofontes
GPG Key ID: EE3447CE80048495
3 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1 @@
CONTABO_BACKUP_PATH="/home/bruno/Backups/Contabo"

1
Services/backup-contabo.service Executable file → Normal file
View File

@ -3,3 +3,4 @@ Description=Backup contabo daily
[Service] [Service]
ExecStart=/home/bruno/Backups/Contabo/backup-contabo.sh ExecStart=/home/bruno/Backups/Contabo/backup-contabo.sh
EnvironmentFile=/home/bruno/Apps/linuxShortcuts/Services/backup-contabo.env

View File

@ -1,4 +1,10 @@
#! /bin/bash #! /bin/bash
if [[ `nmcli -t -f GENERAL.METERED dev show | grep "METERED:yes"` ]]; then
echo Backup does not work on metered connections
exit 1
fi
if [[ -z $CONTABO_BACKUP_PATH ]]; then if [[ -z $CONTABO_BACKUP_PATH ]]; then
echo CONTABO_BACKUP_PATH environment not set echo CONTABO_BACKUP_PATH environment not set
exit 1 exit 1