#!/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