I was looking the actual cause of this error as already given the permission to /tmp/backup
permission to /tmp/backup
drwx------ 4 postgres postgres 4.0K Oct 24 10:10 backup
still giving error
As given below error
==================
pg_basebackup -P -v -D /tmp/backup/new1 -x -Ft -z -U base_backup_user -h 127.0.0.1
Password:
transaction log start point: 0/DF000060 on timeline 1
pg_basebackup: could not get backup header: ERROR: could not open directory "./backup": Permission denied
===============
In the next step I found one more backup directory in location "/var/lib/pgsql/9.4/data" check its permission
drwx------ 2 root root 4.0K Oct 24 05:01 backup
changed the permission as in location /va/lib/pgsql/9.4/data
chown -R postgres:postgres backup/
pg_basebackup works fine
Its strange to me I am taking backup in location "/tmp/backup/new1" but I have to check the permission of "/var/lib/pgsql/9.4/data/backup"
I am mysql guy and new to postgresql may be missed some basics of postgresql