On Aug 5, 2016, at 4:05 AM, Martin Petersson 
<mar...@uanet.se<mailto:mar...@uanet.se>> wrote:

Hello,

I need to backup or dump the database to a .bak file, it´s Request Tracker 
4.0.7.
Frits i tried this:
root@rt:~# pg_dump rtdb > rtdb-backup
pg_dump: [archove (db)] connection against database "rtdb" failed: FATAL:  role 
"root" does not exist

Then i tried:
root@rt:~# su postgres
postgres@rt:/root$ pg_dump rtdb > rtdb-backup
bash: rtdb-backup: Access denied

What do i have to do to create a backup of the database?

Use 'su - postgres' instead to become postgres instead of just get the 
permissions of postgres.  If that doesn't work because it doesn't have a shell 
try sudo but ultimately you need to be in a place you can write to while having 
the permissions of postgres or specify the location in the redirect.

eg:
# su postgres
$ pg_dump rtdb -> /tmp/rtdb-backup

--
Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
📧 lstew...@internap.com<mailto:lstew...@internap.com>
🌍 www.internap.com<http://www.internap.com>

---------
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Los Angeles - September, 2016

Reply via email to