1
I have pg_dump command in cron that accesses PostgreSQL under user postgres and does not provide a password.
pg_dump --username=postgres ...
I have set in pg_hba.conf that user postgres should be trusted for all databases from localhost.
local all postgres trust
When I run the command under regular user it works.
When I run it under root (sudo -i) it requires password, and therefore the crontab task fails to authenticate.
Could someone explain to me what is happening here?
Disclaimer: I am Linux n00b.
2Thanks for coming back to post the response, it was very useful to me – Angel Blanco – 2016-06-14T13:30:02.610