Difference between revisions of "SUNScholar/Disaster Recovery/Preparation"

From Libopedia
Jump to navigation Jump to search
m (Text replacement - "{{SUNScholar}}" to "")
m
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<center>
 +
'''[[SUNScholar/Disaster Recovery/System Monitor/Client|Back to Disaster Recovery - System Monitor Client]]'''
  
 +
'''[[SUNScholar/Disaster Recovery/Backups/Local|Back to Disaster Recovery - Local Backup Script]]'''
 +
</center>
  
 
==PostgreSQL Database Credentials==
 
==PostgreSQL Database Credentials==
 
Create a credentials file for the postgres or dspace user.
 
Create a credentials file for the postgres or dspace user.
 
See:
 
See:
* http://www.postgresql.org/docs/8.4/interactive/libpq-pgpass.html
+
* http://www.postgresql.org/docs/9.1/interactive/libpq-pgpass.html
 
* http://www.pgadmin.org/docs/1.4/pg/libpq-pgpass.html
 
* http://www.pgadmin.org/docs/1.4/pg/libpq-pgpass.html
 
Open a terminal on the server and type the following:
 
Open a terminal on the server and type the following:
Line 16: Line 20:
 
Copy and paste the following into the file:
 
Copy and paste the following into the file:
 
  localhost:5432:dspace:dspace:dspace
 
  localhost:5432:dspace:dspace:dspace
Press '''CTL+O''' and '''CTL+X''' to save and exit the file.
+
This file should contain lines of the following format: '''''hostname:port:database:username:password'''''
  
 
To lock down file permissions type.
 
To lock down file permissions type.
Line 24: Line 28:
 
  psql
 
  psql
  
You should be connected to the database now.
+
You should be automatically connected to the database now.
  
 
To quit the database type.
 
To quit the database type.
 
  '''\q'''
 
  '''\q'''
 +
[[Category:System Administration]]

Latest revision as of 11:18, 28 May 2016

Back to Disaster Recovery - System Monitor Client
Back to Disaster Recovery - Local Backup Script

PostgreSQL Database Credentials

Create a credentials file for the postgres or dspace user. See:

Open a terminal on the server and type the following:

To become the postgres user.

su - postgres

To create the credential file type.

 nano ~/.pgpass

Copy and paste the following into the file:

localhost:5432:dspace:dspace:dspace

This file should contain lines of the following format: hostname:port:database:username:password

To lock down file permissions type.

chmod 0600 ~/.pgpass

To test type.

psql

You should be automatically connected to the database now.

To quit the database type.

\q