forked from evolix/evocheck
IS_BACKUPUPTODATE : check backup dates in the correct directory
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
|
### Changed
|
||||||
|
|
||||||
* IS_EVOMAINTENANCE_FW : warn only if HOOK_DB is enabled
|
* IS_EVOMAINTENANCE_FW : warn only if HOOK_DB is enabled
|
||||||
|
* IS_BACKUPUPTODATE : check backup dates in the correct directory
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|
15
evocheck.sh
15
evocheck.sh
|
@ -659,9 +659,14 @@ check_muninrunning() {
|
||||||
}
|
}
|
||||||
# Check if files in /home/backup/ are up-to-date
|
# Check if files in /home/backup/ are up-to-date
|
||||||
check_backupuptodate() {
|
check_backupuptodate() {
|
||||||
if [ -d /home/backup/ ]; then
|
# find local backup directory
|
||||||
if [ -n "$(ls -A /home/backup/)" ]; then
|
backup_dir=$(grep --no-messages 'LOCAL_BACKUP_DIR=' /etc/cron.daily/zzz_evobackup | tr -d \" | cut -d= -f2)
|
||||||
for file in /home/backup/*; do
|
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")
|
limit=$(date +"%s" -d "now - 2 day")
|
||||||
updated_at=$(stat -c "%Y" "$file")
|
updated_at=$(stat -c "%Y" "$file")
|
||||||
|
|
||||||
|
@ -671,10 +676,10 @@ check_backupuptodate() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
failed "IS_BACKUPUPTODATE" "/home/backup/ is empty"
|
failed "IS_BACKUPUPTODATE" "${backup_dir}/ is empty"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
failed "IS_BACKUPUPTODATE" "/home/backup/ is missing"
|
failed "IS_BACKUPUPTODATE" "${backup_dir}/ is missing"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
check_etcgit() {
|
check_etcgit() {
|
||||||
|
|
Loading…
Reference in a new issue