I tried seting up Amanda backup on AWS using openhab-config but it had an error on slot 9 after creating labels for slots 15-10.
+ su - backup -c 'amlabel openhab-AWS openhab-AWS-9 slot 09'
Reading label...
Slot 09 not defined
Doing a bit of testing I realized the amlabel command doesn't like the 'slot 09' parameter, it expects it to be sent as 'slot 9'. At the same time 'openhab-AWS-9' should be 'openhab-AWS-09' to comply with the format defined in amand.conf "openhab-AWS-%%".
So I looked at the backup.sh script and I switched those two around to make it work, don't know if this is the correct way to fix it but it fixed it for me.
Old:
if ! cond_redirect su - "$backupUser" -c "amlabel ${config} ${config}-${tapes} slot $(printf "%02d" "${tapes}")"; then echo "FAILED (amlabel)"; return 1; fi
New:
if ! cond_redirect su - "$backupUser" -c "amlabel ${config} ${config}-$(printf "%02d" "${tapes}") slot ${tapes}"; then echo "FAILED (amlabel)"; return 1; fi
Debug information:
full log
[16:24:08] openhabian@openhab-pi:~$ sudo openhabian-config
[sudo] password for openhabian:
2021-10-06_16:24:21_-03 [openHABian] Checking for root privileges... OK
+ export UNATTENDED SILENT DEBUGMAX INTERACTIVE
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/auth.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/backup.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/config.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/ext-storage.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/find.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/habapp.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/helpers.bash
++ ESC='\033['
++ COL_DEF='\033[39;49;00m'
++ COL_RED='\033[31;01m'
++ COL_GREEN='\033[32;01m'
++ COL_YELLOW='\033[33;01m'
++ COL_BLUE='\033[34;01m'
++ COL_MAGENTA='\033[35;01m'
++ COL_CYAN='\033[36;01m'
++ COL_LGRAY='\033[37;01m'
++ COL_DGRAY='\033[90;01m'
++ export COL_DEF COL_RED COL_GREEN COL_YELLOW COL_BLUE COL_MAGENTA COL_CYAN COL_LGRAY COL_DGRAY
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/influxdb+grafana.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/java-jre.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/menu.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/nodejs-apps.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/openhab.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/openhabian.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/packages.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/system.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/vpn.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/wifi.bash
+ for shfile in "${BASEDIR:-/opt/openhabian}"/functions/*.bash
+ source /opt/openhabian/functions/zram.bash
++ pwd
+ OLDWD=/home/openhabian
+ cd /opt
+ update_openhabian_conf
+ local configFile=/etc/openhabian.conf
+ local referenceConfig=/opt/openhabian/build-image/openhabian.conf
+ cp /etc/openhabian.conf /etc/openhabian.conf.BAK
+ read -r line
+ [[ # Origin: openhabian.conf =~ ^(#)?[a-zA-Z] ]]
+ echo '# Origin: openhabian.conf'
+ read -r line
+ [[ # =~ ^(#)?[a-zA-Z] ]]
+ echo '#'
+ read -r line
+ [[ # Modify your openHABian settings =~ ^(#)?[a-zA-Z] ]]
+ echo '# Modify your openHABian settings'
+ read -r line
+ [[ # Handle with care, only touch if you need to! =~ ^(#)?[a-zA-Z] ]]
+ echo '# Handle with care, only touch if you need to!'
+ read -r line
+ [[ # This file will only be used on unattended initial install. =~ ^(#)?[a-zA-Z] ]]
+ echo '# This file will only be used on unattended initial install.'
+ read -r line
+ [[ # If you want to change anything after unattended install completed, use menu in openhabian-config. =~ ^(#)?[a-zA-Z] ]]
+ echo '# If you want to change anything after unattended install completed, use menu in openhabian-config.'
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # Hostname to set this one to =~ ^(#)?[a-zA-Z] ]]
+ echo '# Hostname to set this one to'
+ read -r line
+ [[ hostname=openhabian =~ ^(#)?[a-zA-Z] ]]
+ parsed=hostname=openhabian
+ [[ hostname=openhabian =~ ^#[a-zA-Z] ]]
++ echo hostname=openhabian
++ cut -d= -f1
+ param=hostname
+ [[ -v hostname ]]
+ [[ openhab == *\ * ]]
+ echo hostname=openhab
+ read -r line
+ [[ # if it exists, the default user (with its working environment) will be renamed to this username given here ... =~ ^(#)?[a-zA-Z] ]]
+ echo '# if it exists, the default user (with its working environment) will be renamed to this username given here ...'
+ read -r line
+ [[ username=openhabian =~ ^(#)?[a-zA-Z] ]]
+ parsed=username=openhabian
+ [[ username=openhabian =~ ^#[a-zA-Z] ]]
++ echo username=openhabian
++ cut -d= -f1
+ param=username
+ [[ -v username ]]
+ [[ openhabian == *\ * ]]
+ echo username=openhabian
+ read -r line
+ [[ # ... and given this password. The password will be removed from this file after completion for security reasons. =~ ^(#)?[a-zA-Z] ]]
+ echo '# ... and given this password. The password will be removed from this file after completion for security reasons.'
+ read -r line
+ [[ userpw=openhabian =~ ^(#)?[a-zA-Z] ]]
+ parsed=userpw=openhabian
+ [[ userpw=openhabian =~ ^#[a-zA-Z] ]]
++ echo userpw=openhabian
++ cut -d= -f1
+ param=userpw
+ [[ -v userpw ]]
+ [[ openhabian == *\ * ]]
+ echo userpw=openhabian
+ read -r line
+ [[ # set this to download a SSH key and authorize the owner to login as the admin user =~ ^(#)?[a-zA-Z] ]]
+ echo '# set this to download a SSH key and authorize the owner to login as the admin user'
+ read -r line
+ [[ adminkeyurl="" =~ ^(#)?[a-zA-Z] ]]
+ parsed='adminkeyurl=""'
+ [[ adminkeyurl="" =~ ^#[a-zA-Z] ]]
++ echo 'adminkeyurl=""'
++ cut -d= -f1
+ param=adminkeyurl
+ [[ -v adminkeyurl ]]
+ [[ '' == *\ * ]]
+ echo adminkeyurl=
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # Language and timezone. See Debian documentation for valid values. =~ ^(#)?[a-zA-Z] ]]
+ echo '# Language and timezone. See Debian documentation for valid values.'
+ read -r line
+ [[ timezone=Europe/Berlin =~ ^(#)?[a-zA-Z] ]]
+ parsed=timezone=Europe/Berlin
+ [[ timezone=Europe/Berlin =~ ^#[a-zA-Z] ]]
++ echo timezone=Europe/Berlin
++ cut -d= -f1
+ param=timezone
+ [[ -v timezone ]]
+ [[ Europe/Berlin == *\ * ]]
+ echo timezone=Europe/Berlin
+ read -r line
+ [[ locales="en_US.UTF-8 de_DE.UTF-8" =~ ^(#)?[a-zA-Z] ]]
+ parsed='locales="en_US.UTF-8 de_DE.UTF-8"'
+ [[ locales="en_US.UTF-8 de_DE.UTF-8" =~ ^#[a-zA-Z] ]]
++ echo 'locales="en_US.UTF-8 de_DE.UTF-8"'
++ cut -d= -f1
+ param=locales
+ [[ -v locales ]]
+ [[ en_US.UTF-8 de_DE.UTF-8 == *\ * ]]
+ echo 'locales="en_US.UTF-8 de_DE.UTF-8"'
+ read -r line
+ [[ system_default_locale="en_US.UTF-8" =~ ^(#)?[a-zA-Z] ]]
+ parsed='system_default_locale="en_US.UTF-8"'
+ [[ system_default_locale="en_US.UTF-8" =~ ^#[a-zA-Z] ]]
++ echo 'system_default_locale="en_US.UTF-8"'
++ cut -d= -f1
+ param=system_default_locale
+ [[ -v system_default_locale ]]
+ [[ en_US.UTF-8 == *\ * ]]
+ echo system_default_locale=en_US.UTF-8
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # WiFi settings. An ethernet connection is recommended. =~ ^(#)?[a-zA-Z] ]]
+ echo '# WiFi settings. An ethernet connection is recommended.'
+ read -r line
+ [[ # If you have a RPi4, RPi3, RPi0W or a supported external WiFi dongle, the WiFi =~ ^(#)?[a-zA-Z] ]]
+ echo '# If you have a RPi4, RPi3, RPi0W or a supported external WiFi dongle, the WiFi'
+ read -r line
+ [[ # interface can be setup and used for the initial installation. =~ ^(#)?[a-zA-Z] ]]
+ echo '# interface can be setup and used for the initial installation.'
+ read -r line
+ [[ # Fill in your SSID and password below, leave empty or put comment in front to =~ ^(#)?[a-zA-Z] ]]
+ echo '# Fill in your SSID and password below, leave empty or put comment in front to'
+ read -r line
+ [[ # have your WiFi remain unchanged/uninitialized. Make sure your Ethernet works. =~ ^(#)?[a-zA-Z] ]]
+ echo '# have your WiFi remain unchanged/uninitialized. Make sure your Ethernet works.'
+ read -r line
+ [[ # ATTENTION: you need to escape these special characters: $, `, ", \, (newline) =~ ^(#)?[a-zA-Z] ]]
+ echo '# ATTENTION: you need to escape these special characters: $, `, ", \, (newline)'
+ read -r line
+ [[ # 'Escaping' means to put an additional \ in front of that character =~ ^(#)?[a-zA-Z] ]]
+ echo '# '\''Escaping'\'' means to put an additional \ in front of that character'
+ read -r line
+ [[ wifi_ssid="" =~ ^(#)?[a-zA-Z] ]]
+ parsed='wifi_ssid=""'
+ [[ wifi_ssid="" =~ ^#[a-zA-Z] ]]
++ echo 'wifi_ssid=""'
++ cut -d= -f1
+ param=wifi_ssid
+ [[ -v wifi_ssid ]]
+ [[ [erased] == *\ * ]]
+ echo wifi_ssid=[erased]
+ read -r line
+ [[ wifi_password="" =~ ^(#)?[a-zA-Z] ]]
+ parsed='wifi_password=""'
+ [[ wifi_password="" =~ ^#[a-zA-Z] ]]
++ echo 'wifi_password=""'
++ cut -d= -f1
+ param=wifi_password
+ [[ -v wifi_password ]]
+ [[ '' == *\ * ]]
+ echo wifi_password=
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # Wi-Fi setting. Select a two-letter country code suitable for your location =~ ^(#)?[a-zA-Z] ]]
+ echo '# Wi-Fi setting. Select a two-letter country code suitable for your location'
+ read -r line
+ [[ # E.g. US (default), DE, AU, NZ... =~ ^(#)?[a-zA-Z] ]]
+ echo '# E.g. US (default), DE, AU, NZ...'
+ read -r line
+ [[ # You may infringe on local legislature otherwise =~ ^(#)?[a-zA-Z] ]]
+ echo '# You may infringe on local legislature otherwise'
+ read -r line
+ [[ # See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 or /usr/share/zoneinfo/zone.tab =~ ^(#)?[a-zA-Z] ]]
+ echo '# See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 or /usr/share/zoneinfo/zone.tab'
+ read -r line
+ [[ wifi_country="" =~ ^(#)?[a-zA-Z] ]]
+ parsed='wifi_country=""'
+ [[ wifi_country="" =~ ^#[a-zA-Z] ]]
++ echo 'wifi_country=""'
++ cut -d= -f1
+ param=wifi_country
+ [[ -v wifi_country ]]
+ [[ '' == *\ * ]]
+ echo wifi_country=
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # Eventually disable all IPv6 e.g. on installation problems =~ ^(#)?[a-zA-Z] ]]
+ echo '# Eventually disable all IPv6 e.g. on installation problems'
+ read -r line
+ [[ # values: "enable", "disable" =~ ^(#)?[a-zA-Z] ]]
+ echo '# values: "enable", "disable"'
+ read -r line
+ [[ ipv6=enable =~ ^(#)?[a-zA-Z] ]]
+ parsed=ipv6=enable
+ [[ ipv6=enable =~ ^#[a-zA-Z] ]]
++ echo ipv6=enable
++ cut -d= -f1
+ param=ipv6
+ [[ -v ipv6 ]]
+ [[ enable == *\ * ]]
+ echo ipv6=enable
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # repo and branch to clone from =~ ^(#)?[a-zA-Z] ]]
+ echo '# repo and branch to clone from'
+ read -r line
+ [[ repositoryurl=https://github.com/openhab/openhabian.git =~ ^(#)?[a-zA-Z] ]]
+ parsed=repositoryurl=https://github.com/openhab/openhabian.git
+ [[ repositoryurl=https://github.com/openhab/openhabian.git =~ ^#[a-zA-Z] ]]
++ echo repositoryurl=https://github.com/openhab/openhabian.git
++ cut -d= -f1
+ param=repositoryurl
+ [[ -v repositoryurl ]]
+ [[ https://github.com/openhab/openhabian.git == *\ * ]]
+ echo repositoryurl=https://github.com/openhab/openhabian.git
+ read -r line
+ [[ clonebranch=openHAB3 =~ ^(#)?[a-zA-Z] ]]
+ parsed=clonebranch=openHAB3
+ [[ clonebranch=openHAB3 =~ ^#[a-zA-Z] ]]
++ echo clonebranch=openHAB3
++ cut -d= -f1
+ param=clonebranch
+ [[ -v clonebranch ]]
+ [[ openHAB3 == *\ * ]]
+ echo clonebranch=openHAB3
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # initial openHAB configuration to import (URL or filename) =~ ^(#)?[a-zA-Z] ]]
+ echo '# initial openHAB configuration to import (URL or filename)'
+ read -r line
+ [[ # the file needs to be a zip archive created from openhab-cli backup =~ ^(#)?[a-zA-Z] ]]
+ echo '# the file needs to be a zip archive created from openhab-cli backup'
+ read -r line
+ [[ # initialconfig=/boot/initial.zip =~ ^(#)?[a-zA-Z] ]]
+ echo '# initialconfig=/boot/initial.zip'
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # debug verbosity mode =~ ^(#)?[a-zA-Z] ]]
+ echo '# debug verbosity mode'
+ read -r line
+ [[ # off, on (verbose output in log) or maximum (show every command) =~ ^(#)?[a-zA-Z] ]]
+ echo '# off, on (verbose output in log) or maximum (show every command)'
+ read -r line
+ [[ debugmode=off =~ ^(#)?[a-zA-Z] ]]
+ parsed=debugmode=off
+ [[ debugmode=off =~ ^#[a-zA-Z] ]]
++ echo debugmode=off
++ cut -d= -f1
+ param=debugmode
+ [[ -v debugmode ]]
+ [[ maximum == *\ * ]]
+ echo debugmode=maximum
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # fake hardware =~ ^(#)?[a-zA-Z] ]]
+ echo '# fake hardware'
+ read -r line
+ [[ # force treating your box as if it was a ... =~ ^(#)?[a-zA-Z] ]]
+ echo '# force treating your box as if it was a ...'
+ read -r line
+ [[ # pi4, pi4_8gb, cm4, pi400, pi3, cm3, pi3+, cm3+, pi2, pi1, cm1, pi0, pi0w, x86 =~ ^(#)?[a-zA-Z] ]]
+ echo '# pi4, pi4_8gb, cm4, pi400, pi3, cm3, pi3+, cm3+, pi2, pi1, cm1, pi0, pi0w, x86'
+ read -r line
+ [[ # hw= =~ ^(#)?[a-zA-Z] ]]
+ echo '# hw='
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # Hardware architecture =~ ^(#)?[a-zA-Z] ]]
+ echo '# Hardware architecture'
+ read -r line
+ [[ # x86_64, amd64, armv6l, armv7l, aarch64, arm64 =~ ^(#)?[a-zA-Z] ]]
+ echo '# x86_64, amd64, armv6l, armv7l, aarch64, arm64'
+ read -r line
+ [[ # hwarch= =~ ^(#)?[a-zA-Z] ]]
+ echo '# hwarch='
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # OS distribution/release =~ ^(#)?[a-zA-Z] ]]
+ echo '# OS distribution/release'
+ read -r line
+ [[ # Valid arguments: raspios, raspbian, debian, ubuntu, stretch, buster, bionic, focal =~ ^(#)?[a-zA-Z] ]]
+ echo '# Valid arguments: raspios, raspbian, debian, ubuntu, stretch, buster, bionic, focal'
+ read -r line
+ [[ # osrelease= =~ ^(#)?[a-zA-Z] ]]
+ echo '# osrelease='
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # Java architecture mode =~ ^(#)?[a-zA-Z] ]]
+ echo '# Java architecture mode'
+ read -r line
+ [[ # Valid arguments: "Adopt11", "Zulu11-32", or "Zulu11-64" =~ ^(#)?[a-zA-Z] ]]
+ echo '# Valid arguments: "Adopt11", "Zulu11-32", or "Zulu11-64"'
+ read -r line
+ [[ java_opt=Zulu11-32 =~ ^(#)?[a-zA-Z] ]]
+ parsed=java_opt=Zulu11-32
+ [[ java_opt=Zulu11-32 =~ ^#[a-zA-Z] ]]
++ echo java_opt=Zulu11-32
++ cut -d= -f1
+ param=java_opt
+ [[ -v java_opt ]]
+ [[ Zulu8-32 == *\ * ]]
+ echo java_opt=Zulu8-32
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # install zram per default, set to "disable" to skip installation =~ ^(#)?[a-zA-Z] ]]
+ echo '# install zram per default, set to "disable" to skip installation'
+ read -r line
+ [[ zraminstall=enable =~ ^(#)?[a-zA-Z] ]]
+ parsed=zraminstall=enable
+ [[ zraminstall=enable =~ ^#[a-zA-Z] ]]
++ echo zraminstall=enable
++ cut -d= -f1
+ param=zraminstall
+ [[ -v zraminstall ]]
+ [[ enable == *\ * ]]
+ echo zraminstall=enable
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # start comitup hotspot if internet is not reachable =~ ^(#)?[a-zA-Z] ]]
+ echo '# start comitup hotspot if internet is not reachable'
+ read -r line
+ [[ hotspot=enable =~ ^(#)?[a-zA-Z] ]]
+ parsed=hotspot=enable
+ [[ hotspot=enable =~ ^#[a-zA-Z] ]]
++ echo hotspot=enable
++ cut -d= -f1
+ param=hotspot
+ [[ -v hotspot ]]
+ [[ enable == *\ * ]]
+ echo hotspot=enable
+ read -r line
+ [[ hotspotpw=openhabian =~ ^(#)?[a-zA-Z] ]]
+ parsed=hotspotpw=openhabian
+ [[ hotspotpw=openhabian =~ ^#[a-zA-Z] ]]
++ echo hotspotpw=openhabian
++ cut -d= -f1
+ param=hotspotpw
+ [[ -v hotspotpw ]]
+ [[ openhabian == *\ * ]]
+ echo hotspotpw=openhabian
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # external SD card device to backup and mirror the internal SD card to =~ ^(#)?[a-zA-Z] ]]
+ echo '# external SD card device to backup and mirror the internal SD card to'
+ read -r line
+ [[ # backupdrive=/dev/sda =~ ^(#)?[a-zA-Z] ]]
+ echo '# backupdrive=/dev/sda'
+ read -r line
+ [[ storageconfig=openhab-dir =~ ^(#)?[a-zA-Z] ]]
+ parsed=storageconfig=openhab-dir
+ [[ storageconfig=openhab-dir =~ ^#[a-zA-Z] ]]
++ echo storageconfig=openhab-dir
++ cut -d= -f1
+ param=storageconfig
+ [[ -v storageconfig ]]
+ [[ openhab-dir == *\ * ]]
+ echo storageconfig=openhab-dir
+ read -r line
+ [[ storagedir=/storage =~ ^(#)?[a-zA-Z] ]]
+ parsed=storagedir=/storage
+ [[ storagedir=/storage =~ ^#[a-zA-Z] ]]
++ echo storagedir=/storage
++ cut -d= -f1
+ param=storagedir
+ [[ -v storagedir ]]
+ [[ /storage == *\ * ]]
+ echo storagedir=/storage
+ read -r line
+ [[ storagetapes=15 =~ ^(#)?[a-zA-Z] ]]
+ parsed=storagetapes=15
+ [[ storagetapes=15 =~ ^#[a-zA-Z] ]]
++ echo storagetapes=15
++ cut -d= -f1
+ param=storagetapes
+ [[ -v storagetapes ]]
+ [[ 15 == *\ * ]]
+ echo storagetapes=15
+ read -r line
+ [[ storagecapacity=1024 =~ ^(#)?[a-zA-Z] ]]
+ parsed=storagecapacity=1024
+ [[ storagecapacity=1024 =~ ^#[a-zA-Z] ]]
++ echo storagecapacity=1024
++ cut -d= -f1
+ param=storagecapacity
+ [[ -v storagecapacity ]]
+ [[ 1024 == *\ * ]]
+ echo storagecapacity=1024
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # mail relay settings =~ ^(#)?[a-zA-Z] ]]
+ echo '# mail relay settings'
+ read -r line
+ [[ # adminmail=john.doe@foo.bar =~ ^(#)?[a-zA-Z] ]]
+ echo '# adminmail=john.doe@foo.bar'
+ read -r line
+ [[ # relayuser=john.doe@foo.bar =~ ^(#)?[a-zA-Z] ]]
+ echo '# relayuser=john.doe@foo.bar'
+ read -r line
+ [[ # relaypass=secret =~ ^(#)?[a-zA-Z] ]]
+ echo '# relaypass=secret'
+ read -r line
+ [[ # smarthost=smtp.gmail.com =~ ^(#)?[a-zA-Z] ]]
+ echo '# smarthost=smtp.gmail.com'
+ read -r line
+ [[ # smartport=587 =~ ^(#)?[a-zA-Z] ]]
+ echo '# smartport=587'
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # Tailscale VPN =~ ^(#)?[a-zA-Z] ]]
+ echo '# Tailscale VPN'
+ read -r line
+ [[ # preauthkey=tskey-xxxxxxxxxxxxxxxxx =~ ^(#)?[a-zA-Z] ]]
+ echo '# preauthkey=tskey-xxxxxxxxxxxxxxxxx'
+ read -r line
+ [[ # tstags=tag:client =~ ^(#)?[a-zA-Z] ]]
+ echo '# tstags=tag:client'
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # Custom log files =~ ^(#)?[a-zA-Z] ]]
+ echo '# Custom log files'
+ read -r line
+ [[ # custom_log_files=("/var/log/foo.log" "/var/log/bar.log") =~ ^(#)?[a-zA-Z] ]]
+ echo '# custom_log_files=("/var/log/foo.log" "/var/log/bar.log")'
+ read -r line
+ [[ '' =~ ^(#)?[a-zA-Z] ]]
+ echo ''
+ read -r line
+ [[ # vim: filetype=sh =~ ^(#)?[a-zA-Z] ]]
+ echo '# vim: filetype=sh'
+ read -r line
+ set_cpu_speed
+ is_raspios
+ [[ '' == \r\a\s\p\i\o\s ]]
+ is_raspbian
+ [[ '' == \r\a\s\p\b\i\a\n ]]
++ cat /etc/os-release
+ [[ PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" =~ Raspbian ]]
+ return 0
+ return 0
+ running_in_docker
+ [[ -n '' ]]
+ grep -qs 'docker\|lxc' /proc/1/cgroup
+ [[ -f /.dockerenv ]]
+ return 1
+ echo 'GOVERNOR="ondemand"'
+ echo ondemand
+ config_ipv6
+ local aptConf=/etc/apt/apt.conf.d/S90force-ipv4
+ local sysctlConf=/etc/sysctl.d/99-sysctl.conf
+ [[ enable == \d\i\s\a\b\l\e ]]
+ [[ enable == \e\n\a\b\l\e ]]
+ grep -qs '^[[:space:]]*# Disable all IPv6 functionality' /etc/sysctl.d/99-sysctl.conf
+ [[ -n '' ]]
+ apt_update
+ PID_APT=11575
+ whiptail_check
+ apt-get update
++ command -v whiptail
+ [[ -x /usr/bin/whiptail ]]
+ load_create_config
+ local 'questionText=\nWelcome to openHABian!\n\nPlease provide the name of your Linux user i.e. the account you normally log in with.\n\nTypical user names are '\''pi'\'' or '\''ubuntu'\''.'
+ local input
+ [[ -f /etc/openhabian.conf ]]
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:24:22_-03 [openHABian] Loading configuration file '\''/etc/openhabian.conf'\''... '
2021-10-06_16:24:22_-03 [openHABian] Loading configuration file '/etc/openhabian.conf'... ++ getent group openhabian
+ [[ ! -n openhabian:x:1000:openhabian,frontail ]]
+ id -u openhabian
+ source /etc/openhabian.conf
++ hostname=openhab
++ username=openhabian
++ userpw=openhabian
++ adminkeyurl=
++ timezone=Europe/Berlin
++ locales='en_US.UTF-8 de_DE.UTF-8'
++ system_default_locale=en_US.UTF-8
++ wifi_ssid=[erased]
++ wifi_password=
++ wifi_country=
++ ipv6=enable
++ repositoryurl=https://github.com/openhab/openhabian.git
++ clonebranch=openHAB3
++ debugmode=maximum
++ java_opt=Zulu8-32
++ zraminstall=enable
++ hotspot=enable
++ hotspotpw=openhabian
++ storageconfig=openhab-dir
++ storagedir=/storage
++ storagetapes=15
++ storagecapacity=1024
+ echo OK
OK
+ openhabian_console_check
+ [[ -z 1 ]]
++ tput cols
+ [[ 141 -ge 120 ]]
+ return 0
+ openhabian_update_check
+ [[ -z 1 ]]
+ local branch
+ local introText
+ local unsupportedHWText
+ local unsupportedOSText
+ branch=openHAB3
+ introText='Additions, improvements or fixes were added to the openHABian configuration tool. Would you like to update now and benefit from them? The update will not automatically apply changes to your system.\n\nUpdating is recommended.'
+ unsupportedHWText='You are running on old hardware that is no longer officially supported.\nopenHABian may still work with this or not.\nWe recommend that you replace your hardware with a current SBC such as a RPi4/2GB.\nDo you really want to continue using openHABian on this system?'
+ unsupportedOSText='You are running an old Linux release that is no longer officially supported.\nWe recommend upgrading to the most current stable release of your distribution (or current Long Term Support version for distributions that offer LTS).\nDo you really want to continue using openHABian on this system?'
++ timestamp
++ date +%F_%T_%Z
++ get_git_revision
++ local branch
++ local commitDate
++ local shorthash
+++ git -C /opt/openhabian rev-parse --abbrev-ref HEAD
++ branch=openHAB3
+++ git -C /opt/openhabian log --pretty=format:%aI -n 1
++ commitDate=2021-09-02T22:55:03+02:00
+++ git -C /opt/openhabian log --pretty=format:%h -n 1
++ shorthash=3cdb213
++ echo '[openHAB3]{2021-09-02T22:55:03+02:00}(3cdb213)'
+ echo '2021-10-06_16:24:22_-03 [openHABian] openHABian configuration tool version: [openHAB3]{2021-09-02T22:55:03+02:00}(3cdb213)'
2021-10-06_16:24:22_-03 [openHABian] openHABian configuration tool version: [openHAB3]{2021-09-02T22:55:03+02:00}(3cdb213)
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:24:22_-03 [openHABian] Checking for changes in origin branch openHAB3... '
2021-10-06_16:24:22_-03 [openHABian] Checking for changes in origin branch openHAB3... + is_pine64
++ uname -r
+ [[ 5.10.60-v7+ =~ pine64-longsleep ]]
+ return 1
+ is_jessie
+ [[ '' == \j\e\s\s\i\e ]]
++ cat /etc/os-release
+ [[ PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" =~ jessie ]]
+ return 1
+ is_xenial
+ [[ '' == \x\e\n\i\a\l ]]
++ cat /etc/os-release
+ [[ PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" =~ xenial ]]
+ return 1
+ git -C /opt/openhabian config user.email openhabian@openHABian
+ git -C /opt/openhabian config user.name openhabian
+ git -C /opt/openhabian fetch --quiet origin
++ git -C /opt/openhabian rev-parse openHAB3
++ git -C /opt/openhabian rev-parse '@{u}'
+ [[ 3cdb213f9b405637d5e9add480ca2779775a71a9 == 3cdb213f9b405637d5e9add480ca2779775a71a9 ]]
+ echo OK
OK
+ openhabian_announcements
+ [[ -z 1 ]]
+ local altReadNews
+ local newsFile
+ local readNews
+ altReadNews=/tmp/NEWS.md
+ newsFile=/opt/openhabian/NEWS.md
+ readNews=/opt/openhabian/docs/NEWS.md
+ cmp --silent /opt/openhabian/NEWS.md /opt/openhabian/docs/NEWS.md
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:24:24_-03 [openHABian] Switching to branch openHAB3... '
2021-10-06_16:24:24_-03 [openHABian] Switching to branch openHAB3... + git -C /opt/openhabian checkout --quiet openHAB3
+ echo OK
OK
+ show_main_menu
+ local choice
+ local version
+++ get_git_revision
+++ local branch
+++ local commitDate
+++ local shorthash
++++ git -C /opt/openhabian rev-parse --abbrev-ref HEAD
+++ branch=openHAB3
++++ git -C /opt/openhabian log --pretty=format:%aI -n 1
+++ commitDate=2021-09-02T22:55:03+02:00
++++ git -C /opt/openhabian log --pretty=format:%h -n 1
+++ shorthash=3cdb213
+++ echo '[openHAB3]{2021-09-02T22:55:03+02:00}(3cdb213)'
++ whiptail --title 'openHABian Configuration Tool — [openHAB3]{2021-09-02T22:55:03+02:00}(3cdb213)' --menu 'Setup Options' 18 116 11 --cancel-button Exit --ok-button Execute '00 | About openHABian' 'Information about the openHABian project and this tool' '' '' '01 | Select Branch' 'Select the openHABian config tool version ("branch") to run' '02 | Upgrade System' 'Update all installed software packages (incl. openHAB) to their latest version' '03 | Install openHAB' 'Install or upgrade to openHAB 3' '' '' '10 | Apply Improvements' 'Apply the latest improvements to the basic openHABian setup ►' '20 | Optional Components' 'Choose from a set of optional software components ►' '30 | System Settings' 'A range of system and hardware related configuration steps ►' '40 | openHAB Related' 'Switch the installed openHAB version or apply tweaks ►' '50 | Backup/Restore' 'Manage backups and restore your system ►'
+ choice='50 | Backup/Restore'
+ RET=0
+ '[' 0 -eq 1 ']'
+ '[' 0 -eq 255 ']'
+ [[ 50 | Backup/Restore == '' ]]
+ [[ 50 | Backup/Restore == \0\0* ]]
+ [[ 50 | Backup/Restore == \0\1* ]]
+ [[ 50 | Backup/Restore == \0\2* ]]
+ [[ 50 | Backup/Restore == \0\3* ]]
+ [[ 50 | Backup/Restore == \1\0* ]]
+ [[ 50 | Backup/Restore == \2\0* ]]
+ [[ 50 | Backup/Restore == \3\0* ]]
+ [[ 50 | Backup/Restore == \4\0* ]]
+ [[ 50 | Backup/Restore == \5\0* ]]
+++ get_git_revision
+++ local branch
+++ local commitDate
+++ local shorthash
++++ git -C /opt/openhabian rev-parse --abbrev-ref HEAD
+++ branch=openHAB3
++++ git -C /opt/openhabian log --pretty=format:%aI -n 1
+++ commitDate=2021-09-02T22:55:03+02:00
++++ git -C /opt/openhabian log --pretty=format:%h -n 1
+++ shorthash=3cdb213
+++ echo '[openHAB3]{2021-09-02T22:55:03+02:00}(3cdb213)'
++ whiptail --title 'openHABian Configuration Tool — [openHAB3]{2021-09-02T22:55:03+02:00}(3cdb213)' --menu Backup/Restore 14 116 7 --cancel-button Back --ok-button Execute '50 | Backup openHAB config' 'Backup the current active openHAB configuration' '51 | Restore an openHAB config' 'Restore a previous openHAB configuration from backup' '52 | Amanda System Backup' 'Set up Amanda to comprehensively backup your complete openHABian box' '53 | Setup SD mirroring' 'Setup mirroring of internal to external SD card' ' | Remove SD mirroring' 'Disable mirroring of SD cards' '54 | Raw copy SD' 'Raw copy internal SD to external disk / SD card' '55 | Sync SD' 'Rsync internal SD to external disk / SD card'
+ choice2='52 | Amanda System Backup'
+ '[' 0 -eq 1 ']'
+ '[' 1 -eq 255 ']'
+ case "$choice2" in
+ wait_for_apt_to_finish_update
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:24:32_-03 [openHABian] Updating Linux package information... '
2021-10-06_16:24:32_-03 [openHABian] Updating Linux package information... + [[ -z 11575 ]]
+ tail --pid=11575 -f /dev/null
+ echo OK
OK
+ amanda_setup
+ [[ -z 1 ]]
+ local config
+ local backupUser=backup
+ local tapes
+ local tapeSize
+ local storageLoc
+ local awsSite
+ local awsBucket
+ local awsAccessKey
+ local awsSecretKey
+ local backupPass
+ local backupPass1
+ local backupPass2
+ local 'queryText=You are about to install the Amanda backup solution.\nDocumentation is available at '\''/opt/openhabian/docs/openhabian-amanda.md'\'' or https://github.com/openhab/openhabian/blob/main/docs/openhabian-amanda.md\nHave you read this document? If not, please do so now, as you will need to follow the instructions provided there in order to successfully complete installation of Amanda.\n\nProceeding will setup a backup mechanism to allow for saving your openHAB setup and modifications to either USB attached or Amazon cloud storage.\nYou can add your own files/directories to be backed up, and you can store and create clones of your openHABian SD card to have an pre-prepared replacement in case of card failures.\n\nWARNING: running this setup will overwrite any previous Amanda backup configurations.\n\nWould you like to begin setup?'
+ local 'successText=Setup was successful.\n\nAmanda backup tool is now taking backups around 01:00. For further readings, start at http://wiki.zmanda.com/index.php/User_documentation.'
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:24:32_-03 [openHABian] Beginning setup of the Amanda backup system... '
2021-10-06_16:24:32_-03 [openHABian] Beginning setup of the Amanda backup system... + whiptail --title 'Amanda backup installation' --yes-button Continue --no-button Cancel --defaultno --yesno 'You are about to install the Amanda backup solution.\nDocumentation is available at '\''/opt/openhabian/docs/openhabian-amanda.md'\'' or https://github.com/openhab/openhabian/blob/main/docs/openhabian-amanda.md\nHave you read this document? If not, please do so now, as you will need to follow the instructions provided there in order to successfully complete installation of Amanda.\n\nProceeding will setup a backup mechanism to allow for saving your openHAB setup and modifications to either USB attached or Amazon cloud storage.\nYou can add your own files/directories to be backed up, and you can store and create clones of your openHABian SD card to have an pre-prepared replacement in case of card failures.\n\nWARNING: running this setup will overwrite any previous Amanda backup configurations.\n\nWould you like to begin setup?' 24 80
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:24:33_-03 [openHABian] Configuring Amanda backup system prerequisites... '
2021-10-06_16:24:33_-03 [openHABian] Configuring Amanda backup system prerequisites... + [[ -z '' ]]
++ whiptail --title 'Authentication setup' --passwordbox '\nEnter a password for backup:' 9 80
+ backupPass1=test
++ whiptail --title 'Authentication setup' --passwordbox '\nPlease confirm the password:' 9 80
+ backupPass2=test
+ [[ test == \t\e\s\t ]]
+ [[ 4 -ge 8 ]]
+ whiptail --title 'Authentication setup' --msgbox 'Password mismatched, blank, or less than 8 characters... Please try again!' 7 80
+ [[ -z '' ]]
++ whiptail --title 'Authentication setup' --passwordbox '\nEnter a password for backup:' 9 80
+ backupPass1=testtest
++ whiptail --title 'Authentication setup' --passwordbox '\nPlease confirm the password:' 9 80
+ backupPass2=testtest
+ [[ testtest == \t\e\s\t\t\e\s\t ]]
+ [[ 8 -ge 8 ]]
+ [[ 8 -ge 8 ]]
+ backupPass=testtest
+ [[ -z testtest ]]
+ amanda_install testtest
+ local backupUser=backup
+ local backupPass=testtest
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:24:57_-03 [openHABian] Configuring Amanda backup system prerequisites... '
2021-10-06_16:24:57_-03 [openHABian] Configuring Amanda backup system prerequisites... + echo backup:testtest
+ cond_redirect chpasswd
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chpasswd \033[39;49;00m'
$ chpasswd
+ chpasswd
+ return 0
+ grep -qs '^[[:space:]]*backup:' /etc/group
+ cond_redirect usermod --append --groups backup openhabian
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups backup openhabian \033[39;49;00m'
$ usermod --append --groups backup openhabian
+ usermod --append --groups backup openhabian
+ return 0
+ cond_redirect usermod --append --groups backup backup
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ usermod --append --groups backup backup \033[39;49;00m'
$ usermod --append --groups backup backup
+ usermod --append --groups backup backup
+ return 0
+ cond_redirect chsh --shell /bin/bash backup
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chsh --shell /bin/bash backup \033[39;49;00m'
$ chsh --shell /bin/bash backup
+ chsh --shell /bin/bash backup
+ return 0
+ echo OK
OK
+ dpkg -s amanda-common amanda-server amanda-client
+ dpkg -s exim4
+ whiptail --title 'Backup using locally attached storage' --yes-button Yes --no-button No --yesno 'Would you like to setup a backup mechanism based on locally attached or NAS mounted storage?' 8 80
+ whiptail --title 'Backup using Amazon AWS' --yes-button Yes --no-button No --defaultno --yesno 'Would you like to setup a backup mechanism based on Amazon Web Services?\n\nYou can get 5 GB of S3 cloud storage for free on https://aws.amazon.com/. For hints see http://markelov.org/wiki/index.php?title=Backup_with_Amanda:_tape,_NAS,_Amazon_S3#Amazon_S3\nPlease setup your S3 bucket on Amazon Web Services NOW if you have not done so. Remember the name has to be unique in AWS namespace.' 14 90
+ config=openhab-AWS
++ whiptail --title 'AWS bucket site location' --inputbox '\nEnter the AWS site location you want to use (e.g. "eu-central-1"):' 9 80
+ awsSite=us-east-2
++ whiptail --title 'AWS bucket name' --inputbox '\nEnter the bucket name you created on AWS (only the part after the last '\'':'\'' of the ARN):' 10 80
+ awsBucket=[erased]
++ whiptail --title 'AWS access key' --inputbox '\nEnter the AWS access key you obtained at S3 setup time:' 9 80
+ awsAccessKey=ERASED
++ whiptail --title 'AWS secret key' --inputbox '\nEnter the AWS secret key you obtained at S3 setup time:' 9 80
+ awsSecretKey=ERASED
+ tapes=15
++ whiptail --title 'Storage capacity' --inputbox '\nHow much storage do you want to dedicate to your backup in megabytes?\n\nRecommendation: 2-3 times the amount of data to be backed up.' 11 80
+ tapeSize=15000
+ (( tapeSize/=tapes ))
+ create_amanda_config openhab-AWS backup root@openhab 15 1000 AWS us-east-2 bucketname[erased] accesskeyname[erased] secretkey[erased]
+ local adminMail
+ local amandaHosts=/var/backups/.amandahosts
+ local amandaSecurityConf=/etc/amanda-security.conf
+ local amandaIncludesDir=/opt/openhabian/includes/amanda
+ local awsAccessKey
+ local awsBucket
+ local awsSecretKey
+ local awsSite
+ local backupUser
+ local config
+ local configDir
+ local databaseDir
+ local dumpType=comp-user-tar
+ local indexDir
+ local logDir
+ local serviceTargetDir=/etc/systemd/system
+ local storageLoc
+ local storageText
+ local tapeChanger
+ local tapes
+ local tapeSize
+ local tapeType
+ config=openhab-AWS
+ backupUser=backup
+ adminMail=root@openhab
+ tapes=15
+ tapeSize=1000
+ storageLoc=AWS
+ awsSite=us-east-2
+ awsBucket=[erased]
+ awsAccessKey=[erased]
+ awsSecretKey=[erased]
+ configDir=/etc/amanda/openhab-AWS
+ databaseDir=/var/lib/amanda/openhab-AWS/curinfo
+ indexDir=/var/lib/amanda/openhab-AWS/index
+ logDir=/var/log/amanda/openhab-AWS
+ storageText='We need to prepare ("label") your storage media.\n\nFor permanent storage such as USB or NAS mounted storage, as well as for cloud based storage, we will create 15 virtual containers.'
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:25:23_-03 [openHABian] Creating Amanda filesystem... '
2021-10-06_16:25:23_-03 [openHABian] Creating Amanda filesystem... + cond_redirect mkdir -p /etc/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/curinfo /var/log/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/index
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ mkdir -p /etc/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/curinfo /var/log/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/index \033[39;49;00m'
$ mkdir -p /etc/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/curinfo /var/log/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/index
+ mkdir -p /etc/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/curinfo /var/log/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/index
+ return 0
+ cond_redirect touch /etc/amanda/openhab-AWS/tapelist
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ touch /etc/amanda/openhab-AWS/tapelist \033[39;49;00m'
$ touch /etc/amanda/openhab-AWS/tapelist
+ touch /etc/amanda/openhab-AWS/tapelist
+ return 0
++ dig +short openhab-pi
+ ip=192.168.86.233
++ host 192.168.86.233
++ cut '-d ' -f1
+ revip=233.86.168.192.in-addr.arpa
+ [[ -n 233.86.168.192.in-addr.arpa ]]
+ echo -e '192.168.86.233 backup amdump\n233.86.168.192.in-addr.arpa backup amdump'
+ echo -e 'openhab backup amdump\nopenhab root amindexd amidxtaped\nlocalhost backup\nlocalhost root amindexd amidxtaped'
+ is_aarch64
+ [[ '' == \a\a\r\c\h\6\4 ]]
+ [[ '' == \a\r\m\6\4 ]]
+ case "$(uname -m)" in
++ uname -m
+ return 1
+ GNUTAR=/usr/bin/tar
+ echo -e 'amgtar:gnutar_path=/usr/bin/tar\n'
+ cond_redirect chown --recursive backup:backup /var/backups/.amandahosts /etc/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/curinfo /var/lib/amanda/openhab-AWS/index /var/log/amanda
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chown --recursive backup:backup /var/backups/.amandahosts /etc/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/curinfo /var/lib/amanda/openhab-AWS/index /var/log/amanda \033[39;49;00m'
$ chown --recursive backup:backup /var/backups/.amandahosts /etc/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/curinfo /var/lib/amanda/openhab-AWS/index /var/log/amanda
+ chown --recursive backup:backup /var/backups/.amandahosts /etc/amanda/openhab-AWS /var/lib/amanda/openhab-AWS/curinfo /var/lib/amanda/openhab-AWS/index /var/log/amanda
+ return 0
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\A\W\S ]]
++ seq -s, 1 15
+ tapeChanger='"chg-multi:s3:bucketname[erased]/openhab-AWS/slot-{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}" # Number of virtual containers in your tapecycle'
+ tapeType=AWS
+ sed -e 's|%CONFIGDIR|/etc/amanda/openhab-AWS|g; s|%CONFIG|openhab-AWS|g; s|%ADMINMAIL|root@openhab|g; s|%TAPESIZE|1000|g; s|%TAPETYPE|AWS|g; s|%TAPECHANGER|"chg-multi:s3:buckedname[erased]/openhab-AWS/slot-{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}" # Number of virtual containers in your tapecycle|g; s|%TAPES|15|g; s|%BACKUPUSER|backup|g' /opt/openhabian/includes/amanda/amanda.conf-template
+ [[ -z root@openhab ]]
+ [[ openhab-AWS = \o\p\e\n\h\a\b\-\A\W\S ]]
+ echo 'device_property "S3_BUCKET_LOCATION" "us-east-2" # Your S3 bucket location (site)'
+ echo 'device_property "STORAGE_API" "AWS4"'
+ echo 'device_property "VERBOSE" "YES"'
+ echo 'device_property "S3_ACCESS_KEY" "[erased]" # Your S3 Access Key'
+ echo 'device_property "S3_SECRET_KEY" "[erased]" # Your S3 Secret Key'
+ echo 'device_property "S3_SSL" "YES" # cURL needs to have S3 Certification Authority in its CA list. If connection fails, try setting this to NO'
+ cond_redirect chmod 644 /etc/amanda/openhab-AWS/amanda.conf
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chmod 644 /etc/amanda/openhab-AWS/amanda.conf \033[39;49;00m'
$ chmod 644 /etc/amanda/openhab-AWS/amanda.conf
+ chmod 644 /etc/amanda/openhab-AWS/amanda.conf
+ return 0
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:25:23_-03 [openHABian] Creating Amanda configuration... '
2021-10-06_16:25:23_-03 [openHABian] Creating Amanda configuration... + [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ echo 'openhab /boot comp-user-tar'
+ echo 'openhab /etc comp-user-tar'
+ [[ -d /var/lib/openhab ]]
+ echo 'openhab /var/lib/openhab comp-user-tar'
+ [[ -d /var/lib/homegear ]]
+ [[ -d /opt/find3/server/main ]]
+ echo 'index_server "localhost"'
+ echo 'tapedev "changer"'
+ echo 'auth "local"'
+ cond_redirect chmod 644 /etc/amanda/openhab-AWS/disklist /etc/amanda/openhab-AWS/amanda-client.conf
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ chmod 644 /etc/amanda/openhab-AWS/disklist /etc/amanda/openhab-AWS/amanda-client.conf \033[39;49;00m'
$ chmod 644 /etc/amanda/openhab-AWS/disklist /etc/amanda/openhab-AWS/amanda-client.conf
+ chmod 644 /etc/amanda/openhab-AWS/disklist /etc/amanda/openhab-AWS/amanda-client.conf
+ return 0
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:25:23_-03 [openHABian] Preparing storage location... '
2021-10-06_16:25:23_-03 [openHABian] Preparing storage location... + [[ -n 1 ]]
+ whiptail --title 'Storage container creation' --yes-button Continue --no-button Cancel --yesno 'We need to prepare ("label") your storage media.\n\nFor permanent storage such as USB or NAS mounted storage, as well as for cloud based storage, we will create 15 virtual containers.' 10 80
+ [[ 15 -le 0 ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\A\W\S ]]
++ printf %02d 15
+ cond_redirect su - backup -c 'amlabel openhab-AWS openhab-AWS-15 slot 15'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ su - backup -c amlabel openhab-AWS openhab-AWS-15 slot 15 \033[39;49;00m'
$ su - backup -c amlabel openhab-AWS openhab-AWS-15 slot 15
+ su - backup -c 'amlabel openhab-AWS openhab-AWS-15 slot 15'
Reading label...
Found an empty tape.
Writing label 'openhab-AWS-15'...
Checking label...
Success!
+ return 0
+ (( tapes-=1 ))
+ [[ 14 -le 0 ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\A\W\S ]]
++ printf %02d 14
+ cond_redirect su - backup -c 'amlabel openhab-AWS openhab-AWS-14 slot 14'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ su - backup -c amlabel openhab-AWS openhab-AWS-14 slot 14 \033[39;49;00m'
$ su - backup -c amlabel openhab-AWS openhab-AWS-14 slot 14
+ su - backup -c 'amlabel openhab-AWS openhab-AWS-14 slot 14'
Reading label...
Found an empty tape.
Writing label 'openhab-AWS-14'...
Checking label...
Success!
+ return 0
+ (( tapes-=1 ))
+ [[ 13 -le 0 ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\A\W\S ]]
++ printf %02d 13
+ cond_redirect su - backup -c 'amlabel openhab-AWS openhab-AWS-13 slot 13'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ su - backup -c amlabel openhab-AWS openhab-AWS-13 slot 13 \033[39;49;00m'
$ su - backup -c amlabel openhab-AWS openhab-AWS-13 slot 13
+ su - backup -c 'amlabel openhab-AWS openhab-AWS-13 slot 13'
Reading label...
Found an empty tape.
Writing label 'openhab-AWS-13'...
Checking label...
Success!
+ return 0
+ (( tapes-=1 ))
+ [[ 12 -le 0 ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\A\W\S ]]
++ printf %02d 12
+ cond_redirect su - backup -c 'amlabel openhab-AWS openhab-AWS-12 slot 12'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ su - backup -c amlabel openhab-AWS openhab-AWS-12 slot 12 \033[39;49;00m'
$ su - backup -c amlabel openhab-AWS openhab-AWS-12 slot 12
+ su - backup -c 'amlabel openhab-AWS openhab-AWS-12 slot 12'
Reading label...
Found an empty tape.
Writing label 'openhab-AWS-12'...
Checking label...
Success!
+ return 0
+ (( tapes-=1 ))
+ [[ 11 -le 0 ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\A\W\S ]]
++ printf %02d 11
+ cond_redirect su - backup -c 'amlabel openhab-AWS openhab-AWS-11 slot 11'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ su - backup -c amlabel openhab-AWS openhab-AWS-11 slot 11 \033[39;49;00m'
$ su - backup -c amlabel openhab-AWS openhab-AWS-11 slot 11
+ su - backup -c 'amlabel openhab-AWS openhab-AWS-11 slot 11'
Reading label...
Found an empty tape.
Writing label 'openhab-AWS-11'...
Checking label...
Success!
+ return 0
+ (( tapes-=1 ))
+ [[ 10 -le 0 ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\A\W\S ]]
++ printf %02d 10
+ cond_redirect su - backup -c 'amlabel openhab-AWS openhab-AWS-10 slot 10'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ su - backup -c amlabel openhab-AWS openhab-AWS-10 slot 10 \033[39;49;00m'
$ su - backup -c amlabel openhab-AWS openhab-AWS-10 slot 10
+ su - backup -c 'amlabel openhab-AWS openhab-AWS-10 slot 10'
Reading label...
Found an empty tape.
Writing label 'openhab-AWS-10'...
Checking label...
Success!
+ return 0
+ (( tapes-=1 ))
+ [[ 9 -le 0 ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\A\W\S ]]
++ printf %02d 9
+ cond_redirect su - backup -c 'amlabel openhab-AWS openhab-AWS-9 slot 09'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ su - backup -c amlabel openhab-AWS openhab-AWS-9 slot 09 \033[39;49;00m'
$ su - backup -c amlabel openhab-AWS openhab-AWS-9 slot 09
+ su - backup -c 'amlabel openhab-AWS openhab-AWS-9 slot 09'
Reading label...
Slot 09 not defined
Slot 09 not defined
+ return 1
+ echo 'FAILED (amlabel)'
FAILED (amlabel)
+ return 1
+ return 1
+ '[' 1 -ne 0 ']'
+ whiptail --msgbox 'There was an error or interruption during the execution of:\n "50 | Backup/Restore"\n\nPlease try again. If the error persists, please read /opt/openhabian/docs/openhabian-DEBUG.md or https://github.com/openhab/openhabian/blob/main/docs/openhabian-DEBUG.md how to proceed.' 14 80
+ return 0
+ true
+ show_main_menu
+ local choice
+ local version
+++ get_git_revision
+++ local branch
+++ local commitDate
+++ local shorthash
++++ git -C /opt/openhabian rev-parse --abbrev-ref HEAD
+++ branch=openHAB3
++++ git -C /opt/openhabian log --pretty=format:%aI -n 1
+++ commitDate=2021-09-02T22:55:03+02:00
++++ git -C /opt/openhabian log --pretty=format:%h -n 1
+++ shorthash=3cdb213
+++ echo '[openHAB3]{2021-09-02T22:55:03+02:00}(3cdb213)'
++ whiptail --title 'openHABian Configuration Tool — [openHAB3]{2021-09-02T22:55:03+02:00}(3cdb213)' --menu 'Setup Options' 18 116 11 --cancel-button Exit --ok-button Execute '00 | About openHABian' 'Information about the openHABian project and this tool' '' '' '01 | Select Branch' 'Select the openHABian config tool version ("branch") to run' '02 | Upgrade System' 'Update all installed software packages (incl. openHAB) to their latest version' '03 | Install openHAB' 'Install or upgrade to openHAB 3' '' '' '10 | Apply Improvements' 'Apply the latest improvements to the basic openHABian setup ►' '20 | Optional Components' 'Choose from a set of optional software components ►' '30 | System Settings' 'A range of system and hardware related configuration steps ►' '40 | openHAB Related' 'Switch the installed openHAB version or apply tweaks ►' '50 | Backup/Restore' 'Manage backups and restore your system ►'
+ choice=
+ RET=255
+ '[' 255 -eq 1 ']'
+ '[' 255 -eq 255 ']'
+ return 255
+ system_check_default_password
+ is_pi
+ is_pifour
+ [[ '' == \p\i\4 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]11[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_cmfour
+ [[ '' == \c\m\4 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]14[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pi400
+ [[ '' == \p\i\4\0\0 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]13[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_cmthreeplus
+ [[ '' == \c\m\3\+ ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]10[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_cmthree
+ [[ '' == \c\m\3 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[aA][0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pithree
+ [[ '' == \p\i\3 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[8dDeE][0-9a-fA-F]$' /proc/cpuinfo
+ return 0
+ return 0
+ local algo
+ local defaultPassword
+ local defaultUser
+ local generatedPassword
+ local introText
+ local originalPassword
+ local salt
+ is_pi
+ is_pifour
+ [[ '' == \p\i\4 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]11[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_cmfour
+ [[ '' == \c\m\4 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]14[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pi400
+ [[ '' == \p\i\4\0\0 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]13[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_cmthreeplus
+ [[ '' == \c\m\3\+ ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]10[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_cmthree
+ [[ '' == \c\m\3 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[aA][0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pithree
+ [[ '' == \p\i\3 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[8dDeE][0-9a-fA-F]$' /proc/cpuinfo
+ return 0
+ return 0
+ id -u pi
+ is_pi
+ is_pifour
+ [[ '' == \p\i\4 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]11[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_cmfour
+ [[ '' == \c\m\4 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]14[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pi400
+ [[ '' == \p\i\4\0\0 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]13[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_cmthreeplus
+ [[ '' == \c\m\3\+ ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]10[0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_cmthree
+ [[ '' == \c\m\3 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[aA][0-9a-fA-F]$' /proc/cpuinfo
+ return 1
+ is_pithree
+ [[ '' == \p\i\3 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[8dDeE][0-9a-fA-F]$' /proc/cpuinfo
+ return 0
+ return 0
+ defaultUser=openhabian
+ defaultPassword=[erased]
++ grep -w openhabian /etc/shadow
++ cut -d: -f2
+ originalPassword='erased'
++ echo 'erased'
++ cut '-d$' -f2
+ algo=6
+ introText='The default password was detected on your system! That is a serious security concern. Bad guys or malicious programs in your subnet are able to gain root access!\n\nPlease set a strong password by typing the command '\''passwd openhabian'\''!'
++ echo 'erased'
++ cut '-d$' -f3
+ salt=erased
+ export algo defaultPassword salt
++ perl -le 'print crypt("$ENV{defaultPassword}","\$$ENV{algo}\$$ENV{salt}\$")'
+ generatedPassword='erased'
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-10-06_16:25:50_-03 [openHABian] Checking for default openHABian username:password combination... '
2021-10-06_16:25:50_-03 [openHABian] Checking for default openHABian username:password combination... ++ id -u openhabian
+ [[ -n 1000 ]]
+ [[ [erased] == [erased] ]]
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -e '2021-10-06_16:25:50_-03 [openHABian] We hope you got what you came for! See you again soon ;)'
2021-10-06_16:25:50_-03 [openHABian] We hope you got what you came for! See you again soon ;)
Issue information:
I tried seting up Amanda backup on AWS using openhab-config but it had an error on slot 9 after creating labels for slots 15-10.
Doing a bit of testing I realized the amlabel command doesn't like the 'slot 09' parameter, it expects it to be sent as 'slot 9'. At the same time 'openhab-AWS-9' should be 'openhab-AWS-09' to comply with the format defined in amand.conf "openhab-AWS-%%".
So I looked at the backup.sh script and I switched those two around to make it work, don't know if this is the correct way to fix it but it fixed it for me.
Old:
if ! cond_redirect su - "$backupUser" -c "amlabel ${config} ${config}-${tapes} slot $(printf "%02d" "${tapes}")"; then echo "FAILED (amlabel)"; return 1; fi
New:if ! cond_redirect su - "$backupUser" -c "amlabel ${config} ${config}-$(printf "%02d" "${tapes}") slot ${tapes}"; then echo "FAILED (amlabel)"; return 1; fi
Debug information:
full log
System information:
Raspberry Pi 3 openhabian