Hello friends, I am back with the new problem i.e how to take automatic database dump and delete old ones.
Now here is an to solve this problem. Here we go:
###Make a .pgpass file in the home directory
Make a file named
.pgpass and write the following code inside that file.
chmod 600 .pgpass
Make a folder for backups
Make a directory named
DB_BACKUPS inside the root directory.
###Create a script for dump
Create a file named
daily_backup at the home directory and write the following code inside that file.
The above example is to take a dump and delete all the files that are older than 10 days.
###Adding a crontab entry
For the automated dump add a crontab entry of the script inside the crontab.
crontab -e and write the following in the crontab