Backup the Production Database

Use pg_dump to create a backup of a running PostgreSQL database.

A beginner Linux challenge worth 3 points. Solve it hands-on in a real Linux environment in your browser - no local setup, no fake shells.

The Challenge

s web app has a PostgreSQL database running in production. Your team lead asks you to create a backup before tomorrow's deployment.\n\nA PostgreSQL server is running inside this lab. The credentials are in /tmp/.env.\n\nYour tasks:\n1. Read the credentials: cat /tmp/.env\n2. Export the database password:\n export $(cat /tmp/.env | xargs)\n3. Backup the appdb database to /tmp/backup.sql:\n pg_dump -U appuser -h localhost appdb > /tmp/backup.sql\n4. Verify the backup is not empty:\n wc -l /tmp/backup.sql\n\nCommands to learn: pg_dump, psql, environment variables, .env files\n\nRun check when done.