#!/bin/bash

# v.0.0.0.1
# 22.4.2024

# scripts check directory collection size limits and if exceeds maximal size, notify via email to recipient
# syntax:
# check_dirs
# setup following constants directories, recipient

# setup following constants - directories
directories=(
    [0,0]="/var/www/quadarax"    # directory name
    [0,1]=10000000               # maximal size in bytes
    [1,0]="/var/www/hosting/geodet-vorlicek.cz"
    [1,1]=10000000
)

# setup following constants - recipient
recipient="dalibor.votruba@gmail.com"

dir_length=${#directories[@]}
for ((i=0; i<$dir_length; i++)); do
    . ./check_dir_size.sh $(directories[$i, 0]) $(directories[$i, 1]) $recipient "MORDOR WARN: Directory exceed size"
done

