Question & Answer
Question
The detailed steps for creating a new backup user for PDA.
Answer
1. Log on as root on ha1 and add a new Linux user:
useradd databkp_usr
echo "databkp_usr<CTRL j>databkp_usr"| passwd databkp_usr
2. Ensure the user was created successfuly. This command:
grep databkp_usr /etc/passwd
should return something like:
databkp_usr:x:503:503::/home/databkp_usr:/bin/bash
3. Log on as root on ha2 and add another user there with the same name and UID:
ssh ha2
useradd databkp_usr
echo "databkp_usr<CTRL j>databkp_usr"| passwd databkp_usr
grep databkp_usr /etc/passwd
4. Create database group with backup and restore privileges, and user:
nzsql -c "Create Group BACKUP_USERS_GRP;"
nzsql -c "Grant Backup, Restore To BACKUP_USERS_GRP ;"
nzsql -c "Create User DATABKP_USR_DB With Password 'xxxxxxxx'
In Group BACKUP_USERS_GRP;"
5. Set environment variables in databkp_usr's .bashrc file on both ha1 and ha2
cd ~databkp_usr
cp ~nz/.bashrc .
vi ./.bashrc
Add or change these lines:
# For NPS
export NZ_USER=databkp_usr_db # Default NZ username#
export NZ_PASSWORD=xxxxxxxx # Default NZ password
export NZ_DATABASE=system # Default NZ database
export NZ_HOST=$(hostname)
6. Login as databkp_usr and take a backup on both ha1 and ha2 to confirm it all works:
nzbackup -db sample_db -dir /tmp -v
Was this topic helpful?
Document Information
Modified date:
17 October 2019
UID
swg21692073