diff --git a/services/mysql-backup.hcl b/services/mysql-backup.hcl index df605e1..046452e 100644 --- a/services/mysql-backup.hcl +++ b/services/mysql-backup.hcl @@ -21,7 +21,9 @@ job "mysql-backup" { data = < /data/compute/appdata/db-backups/mysql/backup.sql + mysqldump -u root --password="$MYSQL_ROOT_PASS" --all-databases > /data/compute/appdata/db-backups/mysql/backup.sql && \ + echo "last_success $(date +%s)" | \ + /run/current-system/sw/bin/curl --data-binary @- http://pushgateway.service.consul:9091/metrics/job/mysql_backup EOH } diff --git a/services/postgres-backup.hcl b/services/postgres-backup.hcl index abc8507..d51810e 100644 --- a/services/postgres-backup.hcl +++ b/services/postgres-backup.hcl @@ -21,7 +21,9 @@ job "postgres-backup" { data = < /data/compute/appdata/db-backups/postgresql/backup.sql + pg_dumpall -U postgres > /data/compute/appdata/db-backups/postgresql/backup.sql && \ + echo "last_success $(date +%s)" | \ + /run/current-system/sw/bin/curl --data-binary @- http://pushgateway.service.consul:9091/metrics/job/postgres_backup EOH }