From f7e65c847ca21ef6a2e7f78d5e47e71b67ec9a61 Mon Sep 17 00:00:00 2001 From: Patrik Holmqvist Date: Tue, 14 Jan 2025 14:48:43 +0100 Subject: [PATCH] Update backup test script --- .../overlay/opt/backuptest/gen-backup-files | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/baas2-backuptest-prod-1.sunet.se/overlay/opt/backuptest/gen-backup-files b/baas2-backuptest-prod-1.sunet.se/overlay/opt/backuptest/gen-backup-files index e69de29..4172093 100755 --- a/baas2-backuptest-prod-1.sunet.se/overlay/opt/backuptest/gen-backup-files +++ b/baas2-backuptest-prod-1.sunet.se/overlay/opt/backuptest/gen-backup-files @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eu + +date_ts=$(date +%s) +backupdir=/opt/backuptest +static_file=$backupdir/file-static-1 +append_file=$backupdir/file-append-1 +checksums_file=$backupdir/checksums.sha256 +ts_file=$backupdir/file-ts-$date_ts + +if ! [ -f $static_file ]; then + echo "static" > $static_file +fi + +echo "$date_ts" >> $append_file + +echo "$date_ts" > "$ts_file" + +cd $backupdir +sha256sum file-* > $checksums_file