- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Server Management - Systems Insight Manager
- >
- Backup Script for HPSIM on linux
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2012 11:39 AM
01-12-2012 11:39 AM
Backup Script for HPSIM on linux
I wrote a short backup script for my linux installation of HP SIM.
Either copy and paste the following or grab the file below.
Feel free to use/modify this for your own purposes.
# Created by: Tim James - tajames@niu.edu
# Creation date: 8/20/2011
# Simple script to backup the whole lot of HP SIM
# Create a temp directory with all the config file locations already propagated
# Copy all of the existing config files into the temp location
# Dump the postgres DB into the temp location
# tar that beast and call it the current date
# NOTE: this makes use of a .pgpass file in the home directory of the user
# that is going to run the script.
dir_loc=/backup/SIM_Bkup
bkup_loc=/backup
bkup_date=`date +"%Y%m%d"`
bkup_day=`date +"%A"`
# Only save 7 days worth of backups.
if [ "$bkup_day" == "Sunday" ]; then
rm /backup/*
fi
# Create temp locations for files.
mkdir -p $dir_loc/etc/opt/mx/config/
mkdir -p $dir_loc/var/opt/mx/config/
mkdir -p $dir_loc/etc/opt/hp/sslshare/
mkdir -p $dir_loc/var/opt/mx/logs/
mkdir -p $dir_loc/opt/mx/bin/
mkdir -p $dir_loc/opt/mx/patch/
mkdir -p $dir_loc/var/opt/mx/output/
cp -R /etc/opt/mx/config $dir_loc/etc/opt/mx/config
cp -R /var/opt/mx/config/ $dir_loc/var/opt/mx/config/
cp -R /etc/opt/hp/sslshare/ $dir_loc/etc/opt/hp/sslshare/
cp /var/opt/mx/logs/mx.log $dir_loc/var/opt/mx/logs/
cp -R /opt/mx/patch/ $dir_loc/opt/mx/patch/
cp /opt/mx/bin/server_cert.pem $dir_loc/opt/mx/bin/
cp /opt/mx/bin/CLIClientConfig.cfg $dir_loc/opt/mx/bin/
cp -R /var/opt/mx/output $dir_loc/var/opt/mx/output/
# PG-DUMP to get the file into a format able to be backed-up
/opt/hpsmdb/bin/pg_dump -h 127.0.0.1 -p 50006 -U mxadmin insight_v1_0 > $dir_loc/saveHPSIMdb
# TAR that meagerie of stuff
tar -zcf $bkup_loc/$bkup_date.tar.gz $dir_loc
# Cleanup the temp files created.
rm -r $dir_loc/