Handle mau
This commit is contained in:
parent
6dfe1496a4
commit
d93cce4fc0
1 changed files with 14 additions and 3 deletions
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
project="${1}"
|
project="${1}"
|
||||||
bucket="${2}"
|
bucket="${2}"
|
||||||
number_of_full_to_keep='<%= @full_backup_retention %>'
|
declare -a sixmonths=('mau')
|
||||||
max_num_inc=$((32 * number_of_full_to_keep))
|
|
||||||
max_num_full=$((2 * number_of_full_to_keep))
|
|
||||||
output_status="OK"
|
output_status="OK"
|
||||||
exit_status=0
|
exit_status=0
|
||||||
problems=""
|
problems=""
|
||||||
|
@ -12,6 +10,19 @@ num_problems=0
|
||||||
data_dir='/opt/backups/data'
|
data_dir='/opt/backups/data'
|
||||||
for project in $(ls ${data_dir}); do
|
for project in $(ls ${data_dir}); do
|
||||||
for bucket in $(ls ${data_dir}/${project}/ | sed 's/\.dat$//'); do
|
for bucket in $(ls ${data_dir}/${project}/ | sed 's/\.dat$//'); do
|
||||||
|
issixmonths="false"
|
||||||
|
for customer in "${sixmonths[@]}"; do
|
||||||
|
if [[ "${bucket}" =~ ${customer} ]]; then
|
||||||
|
issixmonths="true"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
number_of_full_to_keep='<%= @full_backup_retention %>'
|
||||||
|
if [[ "${issixmonths}" == "true" ]]; then
|
||||||
|
number_of_full_to_keep=6
|
||||||
|
fi
|
||||||
|
max_num_inc=$((32 * number_of_full_to_keep))
|
||||||
|
max_num_full=$((2 * number_of_full_to_keep))
|
||||||
|
|
||||||
tabular_data=$(cat "${data_dir}/${project}/${bucket}.dat")
|
tabular_data=$(cat "${data_dir}/${project}/${bucket}.dat")
|
||||||
# We warn if there are too many old backups
|
# We warn if there are too many old backups
|
||||||
num_full=$(echo "${tabular_data}" | grep -c full)
|
num_full=$(echo "${tabular_data}" | grep -c full)
|
||||||
|
|
Loading…
Add table
Reference in a new issue