Simple Database Backup
Recently I was needed to make daily backup of database. This is always a good idea to have most reacent backup of data or source codes. But daily backups… Sound like a perfect task for automation! Most of a time I’m working with PostgreSQL database. And example implemets backups for same db. The bash script: #!/bin/bash date=$(date '+%Y-%m-%d') PGPASSWORD="database_password" \ pg_dump \ --host 127.0.0.1 \ --port 5432 \ -U database_user \ --verbose \ --file "backups/DB_backup_$date....