Updated to include the PBS fingerprint

This commit is contained in:
2024-07-08 12:05:03 -04:00
parent 3d7aef6a35
commit b9631c8c06
2 changed files with 8 additions and 3 deletions

View File

@@ -12,6 +12,7 @@
"options": { "options": {
"pbs_host": "", "pbs_host": "",
"pbs_port": "8007", "pbs_port": "8007",
"pbs_fingerprint": "",
"username": "", "username": "",
"password": "", "password": "",
"auth": "pam or pbs", "auth": "pam or pbs",
@@ -32,6 +33,7 @@
"datastore": "str", "datastore": "str",
"pbs_host": "str", "pbs_host": "str",
"pbs_port": "int", "pbs_port": "int",
"pbs_fingerprint": "str",
"auth": ["match(pam|pbs)"], "auth": ["match(pam|pbs)"],
"namespace": "str", "namespace": "str",
"days_to_keep": "int", "days_to_keep": "int",

View File

@@ -7,6 +7,7 @@ USERNAME=$(bashio::config 'username')
PASSWORD=$(bashio::config 'password') PASSWORD=$(bashio::config 'password')
PBS_HOST=$(bashio::config 'pbs_host') PBS_HOST=$(bashio::config 'pbs_host')
PBS_PORT=$(bashio::config 'pbs_port') PBS_PORT=$(bashio::config 'pbs_port')
PBS_FINGERPRINT=$(bashio::config 'pbs_fingerprint')
DATASTORE=$(bashio::config 'datastore') DATASTORE=$(bashio::config 'datastore')
NAMESPACE=$(bashio::config 'namespace') NAMESPACE=$(bashio::config 'namespace')
INCLUDE=$(bashio::config 'include') INCLUDE=$(bashio::config 'include')
@@ -14,6 +15,7 @@ DAYS_TO_KEEP=$(bashio::config 'days_to_keep')
bashio::log.info "PBS_HOST set to ${PBS_HOST}" bashio::log.info "PBS_HOST set to ${PBS_HOST}"
bashio::log.info "PBS_PORT set to ${PBS_PORT}" bashio::log.info "PBS_PORT set to ${PBS_PORT}"
bashio::log.info "PBS_FINGERPRINT set to ${PBS_FINGERPRINT}"
bashio::log.info "DATASTORE set to ${DATASTORE}" bashio::log.info "DATASTORE set to ${DATASTORE}"
bashio::log.info "NAMESPACE set to ${NAMESPACE}" bashio::log.info "NAMESPACE set to ${NAMESPACE}"
bashio::log.info "USERNAME set to ${USERNAME}" bashio::log.info "USERNAME set to ${USERNAME}"
@@ -42,12 +44,13 @@ bashio::log.info "DAYS_TO_KEEP set to ${DAYS_TO_KEEP}"
bashio::log.info "Setting environment variables" bashio::log.info "Setting environment variables"
export PBS_PASSWORD="${PASSWORD}" export PBS_PASSWORD="${PASSWORD}"
export PBS_REPOSITORY="${USERNAME}@${AUTH}@${PBS_HOST}:${PBS_PORT}:${DATASTORE}" export PBS_REPOSITORY="${USERNAME}@${AUTH}@${PBS_HOST}:${PBS_PORT}:${DATASTORE}"
export PBS_FINGERPRINT="${PBS_FINGERPRINT}"
bashio::log.info "PBS_REPOSITORY set to ${PBS_REPOSITORY}" bashio::log.info "PBS_REPOSITORY set to ${PBS_REPOSITORY}"
INCLUDE_DEV="" INCLUDE_DEV=""
for I in ${INCLUDE}; do for I in ${INCLUDE}; do
INCLUDE_DEV+="--include-dev ${I} " INCLUDE_DEV+="${I}.pxar:/${I}"
done done
bashio::log.info "INCLUDE_DEV set to ${INCLUDE_DEV}" bashio::log.info "INCLUDE_DEV set to ${INCLUDE_DEV}"
@@ -58,9 +61,9 @@ exit 0
# run the backup # run the backup
bashio::log.info "Running the PBS backup..." bashio::log.info "Running the PBS backup..."
if [ -z "${NAMESPACE}" ]; then if [ -z "${NAMESPACE}" ]; then
/usr/bin/proxmox-backup-client backup root.pxar:/ ${INCLUDE_DEV} /usr/bin/proxmox-backup-client backup ${INCLUDE_DEV}
else else
/usr/bin/proxmox-backup-client backup root.pxar:/ --ns ${NAMESPACE} ${INCLUDE_DEV} /usr/bin/proxmox-backup-client backup --ns ${NAMESPACE} ${INCLUDE_DEV}
fi fi
# run the clean up # run the clean up