mirror of
https://github.com/FAUSheppy/athq-vm-management
synced 2025-12-06 22:01:35 +01:00
fix: backup management
This commit is contained in:
@@ -4,14 +4,14 @@ set -eu
|
||||
mkdir -p {{ hostname_base }}
|
||||
cd {{ hostname_base }}
|
||||
|
||||
TYPE=""
|
||||
if [ -z "$1" ]; then
|
||||
if [ $# -ne 0 ]; then
|
||||
TYPE=$1
|
||||
fi
|
||||
|
||||
TEST=$(python -c "int('$TYPE' in ['size_changed', 'no_high_data', 'minimal'])^1")
|
||||
TEST=$(python3 -c "print(int('$TYPE' in ['size_changed', 'no_high_data', 'minimal', ''])^1)")
|
||||
if [ $TEST -ne 0 ]; then
|
||||
echo Bad Filter Option $1
|
||||
echo Bad Filter Option [$TYPE]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dest=./
|
||||
@@ -46,6 +46,14 @@ TOKEN="{{ token }}"
|
||||
if [ $RSYNC_SUCCESS -eq 0 ]; then
|
||||
curl -H "${CONTENT_TYPE}" -X POST "${ASYNC_ICINGA_ADDRESS}" -d \
|
||||
"{\"service\": \"${SERVICE}\", \"token\": \"${TOKEN}\", \"status\": \"OK\", \"info\": \"\"}"
|
||||
|
||||
# if size changed was copied save new size #
|
||||
{% if not size_change_commands %}
|
||||
echo No Sizes to notifiy
|
||||
{% endif %}
|
||||
{% for cmd in size_change_commands %}
|
||||
{{ cmd }}
|
||||
{% endfor %}
|
||||
else
|
||||
curl -H "${CONTENT_TYPE}" -X POST "${ASYNC_ICINGA_ADDRESS}" -d \
|
||||
"{\"service\": \"${SERVICE}\", \"token\": \"${TOKEN}\", \"status\": \"CRITICAL\", \"info\": \"\"}"
|
||||
|
||||
Reference in New Issue
Block a user