Log in to your Hostginger hosting account.
Create a file named .pgbackup in the /home/username directory, where 'username' represents your Hostginger hosting account username.
Copy and paste the following text into the .pgbackup file. Replace 'dbname' with the name of the database you want to back up, 'dbusername' with a user who has access to the database, and 'password' with the database user's password:
#hostname:port:database:username:password localhost:5432:dbname:dbusername:password
Save the changes to the .pgbackup file.
At the command prompt type:
chmod 600 .pgbackup
Create a cronjob that runs the following command. Replace 'dbusername' with the user who has access to the database, replace 'dbname' with the name of the database you want to back up, and replace 'path' with the path where you want to store the database backup file. This example uses backup.pg for the backup's filename, but you can use any filename you want:
/usr/bin/pg_dump --no-password -U dbusername dbname > /path/backup.pg