take into account ENV var for snapshots
This commit is contained in:
2
crontab
2
crontab
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user