In this recipe, you will learn how to back up PostgreSQL databases and recover them in the event of hardware failure or hacker attacks.
Creating and restoring PostgreSQL database backups
Getting ready
Make sure to have a working Django project running with a PostgreSQL database. Deploy that project to a remote staging or production server.
How to do it...
To back up and restore your MySQL database, perform these steps:
- Under the commands directory in your project's home directory, create a bash script, backup_postgresql_db.sh. Start the script with variable and function...