Red Hat Satellite backup fails with an error 'Postgres user needs write access to the backup directory'
Environment
- Red Hat Satellite 6.3
Issue
-
Is it possible to take the online backup of the Satellite on other directories apart from
/tmpand/var/tmp? -
While taking Satellite backup on other directories we get the error 'Postgres user needs write access to the backup directory'.
# satellite-backup /backup Starting backup: 2018-xx-xx xx.xx.xx +xxxx Creating backup folder /backup/satellite-backup-xxxxx Sorry, user root is not allowed to execute '/usr/bin/test -w /backup/satellite-backup-xxxxx' as postgres on satellite.example.com ****cancelled**** Postgres user needs write access to the backup directory Please select a directory, such as /tmp or /var/tmp which allows Postgres write access
Resolution
-
Create a directory and give full (rwx) Permission to postgres user on
/backupdirectory:# mkdir /backup # setfacl -m u:postgres:rwx /backup -
Execute the Satellite backup:
# satellite-backup /backup
For more KB articles/solutions related to Red Hat Satellite 6.x backup issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x backup-related Issues
Root Cause
- The mentioned error occurred because Postgres user cannot write files to other locations apart from
/tmpor/var/tmp.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.