This commit is contained in:
Ramiro Paz
2026-03-09 15:09:06 -03:00
parent 8299f8bc96
commit 0e8fe168ef
85 changed files with 14079 additions and 0 deletions

40
tools/backup.sh Normal file
View File

@ -0,0 +1,40 @@
#!/bin/bash
# Overwrite the previous backup with the current version
./qfixdpl -v > info
gzip -k qfixdpl
cp qfixdpl.gz "backups"
cp conf.toml "backups"
cp info "backups"
# Keep a copy with version info
ver_all=$(./qfixdpl -v | grep Build)
arr=("$ver_all")
ver_aux=${arr[1]}
ver=${ver_aux::-1}
echo "$ver"
mkdir -p "backups/$ver"
mv qfixdpl.gz "backups/$ver"
mv info "backups/$ver"
cp conf.toml "backups/$ver"
# Only keep the indicated number of backups. Delete the oldests ones.
i=0
keep=10
for d in $(ls -dt backups/*/); do
if [[ "$i" -gt "$keep" ]]; then
echo "Deleting: ${d}"
else
echo "Keep: ${d}"
fi
((i++))
done