#!/bin/bash clear; # Archive the PostgreSQL application backup # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Remove the file showing that a previous archiving was successful echo ""; echo -e "\e[1;33mRemove the file showing that a previous archiving was successful...\e[0m"; rm /home/foo/logs/postgresql_backup_archived; echo -e "\e[32mDone\e[0m"; # Archive the whole of the PostgreSQL database backup echo ""; echo -e "\e[1;33mArchive the whole of the PostgreSQL database backup...\e[0m"; rm /home/foo/postgresql_archive.tar.gz; tar -zcpf /home/foo/postgresql_archive.tar.gz /home/foo/backups/postgresql/; # Create a file to show that the archiving has successfully completed echo ""; echo -e "\e[1;33mCreate a file to show that the archiving has successfully completed...\e[0m"; touch /home/foo/logs/postgresql_backup_archived; echo -e "\e[32mDone\e[0m";