我想在ec2实例的ubuntu上使用autopostgresqlbackup。 我可以在命令行上使用psqllogin,它正在拾取我的.pgpass文件,一切都很正常。 当我运行“sudo autopostgresqlbackup”它只是挂起,我的错误文件提到它正在等待postgres用户的密码。
这是我的configuration文件和错误日志。 我正在使用ubuntu用户,并且我的/home/ubuntu/.pgpass文件设置了0600权限。 我猜这是与我login的用户以及在SU_USERNAMEconfiguration行中指定的用户有关。 我应该设置SU_USERNAME = ubuntu吗? 任何帮助在这里将不胜感激。 谢谢。
在/ etc /默认/ autopostgresqlbackup
# =============================== # === Debian specific options === #================================ # By default, on Debian systems, only 'postgres' user # is allowed to access PostgreSQL databases without password. # In order to dump databases we need to run pg_dump/psql # commands as 'postgres' with su. # # The following setting has been added to workraound this issue. # (if it is set to empty, 'su' usage will be disabled) SU_USERNAME=postgres #===================================================================== # Set the following variables to your system needs # (Detailed instructions below variables) #===================================================================== # Username to access the PostgreSQL server eg dbuser USERNAME=postgres # Password # create a file $HOME/.pgpass containing a line like this # hostname:*:*:dbuser:dbpass # replace hostname with the value of DBHOST and postgres with # the value of USERNAME # Host name (or IP address) of PostgreSQL server eg localhost DBHOST=localhost # List of DBNAMES for Daily/Weekly Backup eg "DB1 DB2 DB3" DBNAMES="all"
/var/lib/autopostgresqlbackup/ERRORS_localhost-881271020.log
Password for user postgres: Session terminated, terminating shell... ...killed.
的pg_hba.conf
local all postgres md5 local all all md5 # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 host all all 207.244.165.220/32 md5 host all all 207.244.173.30/32 md5