Backing up your PureFlex Scripts 2240

These are two scripts (Also included as attachments) that I run to backup my PureFlex.

The first is backup_pureflex.sh. Amont other things, it calls the second script, backup_vios.sh.

There are variables you will need to edit in backup_pureflex.sh. It SHOULD be obvious :-)

>>>>>>Ericw

####################################################################cat backup_pureflex.sh #!/bin/sh######################################################################## Written By: Eric Wedaa @ Marist College# Last Update: 2014-09-17 Added V7000 backup to weekly, added mount /backup_dir# 2014-09-18 Added "Assorted Variables" and some notes# Added loops instead of making multiple commands# 2014-09-24 Added notes, keywords, disclaimer######################################################################### $Header: /usr/local/sbin/RCS/backup_pureflex.sh,v 1.5 2014/09/24 20:51:51 root Exp root $# $Date: 2014/09/24 20:51:51 $# $Revision: 1.5 $# $Author: root $############################################################################################################################################### backup_pureflex.sh - Help backup your PureFlex# Copyright (C) 2014 Marist College# 3399 North Road, Poughkeepsie, NY 12601## Disclaimer## Marist College makes no representations about the suitability of any of# the information contained in software programs and related documents# on the Marist College Freeware Download Page for any purpose. All such# software programs and related documents are provided without warranty# of any kind. In no event shall Marist College be liable for damages# whatsoever, including special, indirect or consequential damages,# arising out of or in connection with the use or performance of# information available from the service.######################################################################

######################################################################## NOTES: This script is intended to be run from a Linux server that# has ssh keys setup to (and sometimes from) the different# vios, V7000, FSM## Luckily the CMMs and IMMs can be backed up from the FSM# so once you can ssh to the FSM you can back those up as # well.## You WILL have to setup root ssh/authorized_keys for your# SCE server as well.## You WILL have to setup root ssh/authorized_keys for each of# the VIOs as well in order to mount the backup-directory.## This script kind of assumes you have a user "pureflex"# with a home directory of /home/pureflex# and that you don't mind putting in a password into a# script.## For the FSM backup...# If you get "Authentication with the SFTP server failed. # Check the user name and password."# then you should check file ownership and permissions of# your target directory.## It is STRONGLY advised that this script be owned by root# and is chmod 700## It may not be the nicest code, but it works for us :-)######################################################################## Suggested crontab entries here# 12 4 * * * /usr/local/sbin/backup_pureflex.sh -daily# 12 4 * * 0 /usr/local/sbin/backup_pureflex.sh -weekly# 12 4 1 * * /usr/local/sbin/backup_pureflex.sh -monthly######################################################################### Assorted Variables here#######################################################################PATH_TO_SCRIPTS="/usr/local/sbin/"DATE=`date +%Y.%m.%d`FQHN_FOR_THIS_HOST="HOSTNAME of host where this script is run"PUREFLEX_USER_ON_THIS_HOST="pureflex"SECRET_PASSWORD_FOR_PUREFLEX_USER="MY SECRET PASSWORD"

# This is passed to each vio as part of a mount command# and should be a local (to the server this script is# run on) path# This better be exported to all your VIOsband might need to be chmod 777NFS_MOUNT_POINT="cfg.it.marist.edu:/home/pureflex/dn/vios"

#####################################################################################cat backup_vios.sh #!/bin/sh######################################################################## Written By: Eric Wedaa @ Marist College# Last Update: 2014-09-18 Added notes######################################################################### $Header: /usr/local/sbin/RCS/backup_vios.sh,v 1.3 2014/09/24 20:51:38 root Exp root $# $Date: 2014/09/24 20:51:38 $# $Revision: 1.3 $# $Author: root $######################################################################### NOTES: This script is intended to be run from a Linux server that# has ssh keys setup to (and sometimes from) the different# vios, V7000, FSM## Typically it is called by backup_pureflex.sh, as that makes# sure that /backup_dir is created and mounted on the VIOs.######################################################################## backup_vios.sh - Help backup your VIOs# Copyright (C) 2014 Marist College# 3399 North Road, Poughkeepsie, NY 12601## Disclaimer## Marist College makes no representations about the suitability of any of# the information contained in software programs and related documents # on the Marist College Freeware Download Page for any purpose. All such # software programs and related documents are provided without warranty # of any kind. In no event shall Marist College be liable for damages # whatsoever, including special, indirect or consequential damages, # arising out of or in connection with the use or performance of # information available from the service.######################################################################

if [ "$LEVEL" = "daily" ] ; then #http://www.torontoaix.com/vio-how-to-s/manual-vios-config-backup # We recommend gathering the following additional information # to the lsmap command. This information enables the Virtual # I/O Server to be rebuilt from the install media if necessary.