mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 21:33:28 +01:00
feat - Add checksum time, and hash output to Zabbix
This commit is contained in:
@@ -438,7 +438,7 @@ Otherwise, override them per backup job. Additional backup jobs can be scheduled
|
||||
| `DB01_EXTRA_ENUMERATION_OPTS` | Pass extra arguments to the database enumeration command only, add them here e.g. `--extra-command` | |
|
||||
| `DB01_EXTRA_OPTS` | Pass extra arguments to the backup and database enumeration command, add them here e.g. `--extra-command` | |
|
||||
| `DB01_LOG_LEVEL` | Log output on screen and in files `INFO` `NOTICE` `ERROR` `WARN` `DEBUG` | `debug` |
|
||||
| `DEFAULT_RESOURCE_OPTIMIZED` | Perform operations at a lower priority to the CPU scheduler | `FALSE` |
|
||||
| `DB01_RESOURCE_OPTIMIZED` | Perform operations at a lower priority to the CPU scheduler | `FALSE` |
|
||||
| `DB01_SKIP_AVAILABILITY_CHECK` | Before backing up - skip connectivity check | `FALSE` |
|
||||
|
||||
##### Compression Options
|
||||
|
||||
@@ -998,12 +998,16 @@ generate_checksum() {
|
||||
;;
|
||||
esac
|
||||
|
||||
checksum_routines_start_time=$(date +'%s')
|
||||
write_log notice "Generating ${checksum_extension^^} for '${target}'"
|
||||
cd "${TEMP_PATH}"
|
||||
run_as_user ${checksum_command} "${target}" | run_as_user tee "${target}"."${checksum_extension}" > /dev/null
|
||||
chmod ${backup_job_filesystem_permission} "${target}"."${checksum_extension}"
|
||||
checksum_value=$(run_as_user cat "${target}"."${checksum_extension}" | awk '{print $1}')
|
||||
checksum_routines_finish_time=$(date +'%s')
|
||||
checksum_routines_total_time=$(echo $((checksum_routines_finish_time-checksum_routines_start_time)))
|
||||
write_log debug "${checksum_extension^^}: ${checksum_value} - ${target}"
|
||||
write_log debug "Checksum routines time taken: $(echo ${checksum_routines_total_time} | awk '{printf "Hours: %d Minutes: %02d Seconds: %02d", $1/3600, ($1/60)%60, $1%60}')"
|
||||
else
|
||||
write_log error "Skipping Checksum creation because backup did not complete successfully"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user