IS_BACKUPUPTODATE : check backup dates in the correct directory
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
ae30d6555c
commit
eb4b03f8b1
|
@ -8,6 +8,7 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
|
|||
### Changed
|
||||
|
||||
* IS_EVOMAINTENANCE_FW : warn only if HOOK_DB is enabled
|
||||
* IS_BACKUPUPTODATE : check backup dates in the correct directory
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
15
evocheck.sh
15
evocheck.sh
|
@ -659,9 +659,14 @@ check_muninrunning() {
|
|||
}
|
||||
# Check if files in /home/backup/ are up-to-date
|
||||
check_backupuptodate() {
|
||||
if [ -d /home/backup/ ]; then
|
||||
if [ -n "$(ls -A /home/backup/)" ]; then
|
||||
for file in /home/backup/*; do
|
||||
# find local backup directory
|
||||
backup_dir=$(grep --no-messages 'LOCAL_BACKUP_DIR=' /etc/cron.daily/zzz_evobackup | tr -d \" | cut -d= -f2)
|
||||
if [ -z "${backup_dir}" ]; then
|
||||
backup_dir="/home/backup"
|
||||
fi
|
||||
if [ -d "${backup_dir}" ]; then
|
||||
if [ -n "$(ls -A ${backup_dir})" ]; then
|
||||
for file in ${backup_dir}/*; do
|
||||
limit=$(date +"%s" -d "now - 2 day")
|
||||
updated_at=$(stat -c "%Y" "$file")
|
||||
|
||||
|
@ -671,10 +676,10 @@ check_backupuptodate() {
|
|||
fi
|
||||
done
|
||||
else
|
||||
failed "IS_BACKUPUPTODATE" "/home/backup/ is empty"
|
||||
failed "IS_BACKUPUPTODATE" "${backup_dir}/ is empty"
|
||||
fi
|
||||
else
|
||||
failed "IS_BACKUPUPTODATE" "/home/backup/ is missing"
|
||||
failed "IS_BACKUPUPTODATE" "${backup_dir}/ is missing"
|
||||
fi
|
||||
}
|
||||
check_etcgit() {
|
||||
|
|
Loading…
Reference in a new issue