New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE

SLES OES 2018 trustees backup script, for multiple NSS volumes

SLES OES 2018 trustees backup script, for multiple NSS volumes

My experience is that some customers do not have any backups of there trustee information. If you already do have an rsync. backup script in place, on your OES 2018 servers, ( see my Coolsolution URL https://community.microfocus.com/t5/OES-Tips-Information/SLES-OES-2018-rsync-backup-script-for-multiple-NSS-volumes/ta-p/1778981 )

you can add the under-mentioned trustee script on your OES 2018 servers, which will automatically make a trustees backup when your rsync backup run daily, weekly, or monthly without any human interference.

You need to achieve the steps mentioned below with the trustee backup script:

Use the rsync backup script to make data backups of multiple NSS Volumes to your destination backup server.

Use the trustee script that will make a backup of all your multiple NSS Volumes trustees.

Schedule the trustee script in remote manager (NRM) to run every hour, day, week or month to make backups of the trustees to the multiple NSS Volumes.

A mail will be sent to the recipient's email address if the trustees were backed up successfully or if it failed.

 For the backup of the trustees of the NSS Volumes use metamig as in the under-mentioned example. Metamig is a NSS File System Metadata Migration Utility. Also, see the man page for metamig.

Create the trustee script under the /sbin directory.

Here is an example of the complete trustee script :

#!/bin/bash

/sbin/metamig save DATA1 > /media/nss/DATA1/trustee-bck.txt

if [ $? -eq 0 ]
then
mail -s "rsync backup completed successfully" email_address@co.za < /etc/HOSTNAME
# rsync backup completed successfully @ $(date) for $(hostname)
else
/usr/bin/mail -s "rsync backup failed" email_address@co.za < /etc/HOSTNAME
# rsync failed @ $(date) for $(hostname)
fi

Save the name you want e.g. trustee-bck.sh

Sections of the script is explained below:

metamig save NSSVOL > unfiltered.xml

This command exports the settings of all the files under the volume NSSVOL.

 if [ $? -eq 0 ]
A basic if statement effectively says, if a particular test is true, then perform a given set of actions. $? will contain the exit status of the last command executed.-eq 0 - string1 = string2 is true if the two strings are equal.

mail -s "rsync backup completed successfully" email_address@co.za < /etc/HOSTNAME - /usr/bin/mail -s "rsync backup failed" email_address@co.za < /etc/HOSTNAME
mail to recipient mail address if backup was successful or failed. You can add any detail in the title of the mail message.

Give the script executable permissions with the command - chmod +x trustee-bck.sh as in Figure1.

  

 

Labels (2)

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2020-10-01 13:44
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.