take into account ENV var for snapshots

This commit is contained in:
2026-02-06 12:09:36 +11:00
parent 1cf835b7e7
commit 8e2f0ae340
2 changed files with 6 additions and 2 deletions

View File

@@ -1,2 +1,2 @@
# run once every 5 days or so # run once every 5 days or so
0 23 2-27/5 * * finplan /code/snapshot.sh 0 23 2-27/5 * * finplan cd /tmp && ENV="production" /code/snapshot.sh

View File

@@ -1,6 +1,10 @@
#!/bin/bash #!/bin/bash
DB_FILE="finance.db" if [ "$ENV" == "production" ]; then
DB_FILE="/data/finance.db"
else
DB_FILE="./finance.db"
fi
HISTORY_TABLE="finance_history" HISTORY_TABLE="finance_history"
# Current date in the format you've been using # Current date in the format you've been using
DATE_STR=$(date +%Y-%m-%d) DATE_STR=$(date +%Y-%m-%d)