if [ "$1" == "pre-backup" ]; then # Remove any existing db dump and then create a new one rm -rf $DATA_DIR/postgres/postgres-backup source /baserow/data/.pgpass PGPASSWORD=$DATABASE_PASSWORD pg_dump -j 8 -h localhost -U baserow baserow --format=directory -f $DATA_DIR/postgres/postgres-backup exit fi if [ "$1" == "post-backup" ]; then rm -rf $DATA_DIR/postgres/postgres-backup exit fi if [ "$1" == "pre-restore" ]; then exit fi if [ "$1" == "post-restore" ]; then source /baserow/data/.pgpass PGPASSWORD=$DATABASE_PASSWORD pg_restore -j 8 -h localhost -U baserow -d baserow -c $DATA_DIR/postgres/postgres-backup exit fi