fix: add -T flag in docker compose exec

This commit is contained in:
Mikucat 2024-04-05 15:05:13 +08:00
parent d53df46251
commit 109a510e94
No known key found for this signature in database
GPG Key ID: CE6B09A6F462E04D
2 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@
5. Overwrite judge language config in database from mounted languages.py
```bash
docker compose exec oj-backend python manage.py shell <<EOF
docker compose exec -T oj-backend python manage.py shell <<EOF
from options.options import SysOptions
SysOptions.reset_languages()
EOF

View File

@ -5,16 +5,16 @@
- backup
```bash
docker compose exec postgres pg_dumpall -c -U onlinejudge > "db-$(date -Iseconds).sql"
docker compose exec -T oj-postgres pg_dumpall -c -U onlinejudge > "db-$(date -Iseconds).sql"
# zstd
docker compose exec postgres pg_dumpall -c -U onlinejudge | zstd -o "db-$(date -Iseconds).sql.zst"
docker compose exec -T oj-postgres pg_dumpall -c -U onlinejudge | zstd -o "db-$(date -Iseconds).sql.zst"
```
- restore
```bash
docker compose exec postgres psql < "<backup file>"
docker compose exec -T oj-postgres psql < "<backup file>"
# zstd
zstd -d "<backup file>" | docker compose exec postgres psql