Sample Header Ad - 728x90

Using pgdump_all and cron

0 votes
2 answers
138 views
I have a daily cron job to dump my database. Part of the crontab includes the following:
01	 01	*	*	*	root	/etc/cron.d/backupDaily.sh
and part of the backup script contains the following:
cd /data/pgsql/
sudo -u postgres /usr/pgsql-12/bin/pg_dumpall>/data/pgsql/pg.sql
My old notes refer to putting the credentials in a file such as /.pgpass . However, I have upgraded my server a few times since the beginning, and I don’t appear to have this file anymore. Can anybody tell me how I get away with this? Does this suggest that my postgres user doesn’t have a password? Here is what’s in my pg_hba.conf file:
#   TYPE	DATABASE        USER	ADDRESS			METHOD
	local	replication		all						peer
	host	replication		all		127.0.0.1/32	ident
	host	replication		all		::1/128			ident

	local	all				all						trust

#   IPv4 local connections:
	host	all				all		127.0.0.1/32	trust
	host	all				all		192.168.0.0/24	trust
	host	all				all		192.168.1.0/24	trust
	host	all				all		192.168.77.0/24	trust
Asked by Manngo (3145 rep)
May 6, 2024, 06:41 AM
Last activity: May 6, 2024, 02:34 PM