net-ops/baas2-backuptest-prod-1.sunet.se/overlay/opt/backuptest/gen-backup-files

22 lines
408 B
Text
Raw Normal View History

2025-01-14 14:48:43 +01:00
#!/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