<p>NIM is great for backing up systems and pushing out packages, but there isn&#8217;t a included system for managing mksysb images. &nbsp;I&#8217;ve got a little script that runs on the NIM server and either does a mksysb on all the clients registered or you can specify certain clients. &nbsp;It also keeps X number of old mksysb images and purges the remaining ones. &nbsp;It&#8217;s needs a little cosmetic work, but you can use it as a basis for your own system.</p>
<p><a href='http://patrickv.info/wordpress/wp-content/uploads/2010/08/get_mksysb.txt'>get_mksysb</a></p>
<p>Now, since you have NIM working, you really should run a mksysb backup to tape so you have bootable media to get your NIM server back up. &nbsp;I have two of them, which happen to also be my TSM servers, that I also backup to eachother. &nbsp;Since you can&#8217;t have your NIM master be a client on another NIM server, I have a little script that generates a mksysb on disk (plus any extra VGs) and uses scp to copy the images to the other server.  It&#8217;s stupid simple, and could use come cosmetics, but it works:</p>
<pre><code>#!/bin/ksh
# Usage: mksysb.ksh dest_hostname [ extra_vg ... ]

hostname=`hostname`
dest_host=$1

shift

scp_file() {
        /usr/bin/scp $1 $dest_host:/export/mksysb/$hostname/

}


/usr/bin/mksysb -e -i -X /shared/mksysb.$hostname

if [ $? -eq 0 ]
then
        scp_file /shared/mksysb.$hostname 
else
        echo "mksysb backup failed!"
        exit 1
fi

if [ $? -eq 0 ]
then
        rm /shared/mksysb.$hostname
fi

while [ "$1" != "" ]
do
        savevg -f /shared/$1.savevg $1
        if [ $? -eq 0 ]
        then
                scp_file /shared/$1.savevg
                rm /shared/$1.savevg
        else
                echo "savevg of $1 failed!"
                exit 1
        fi
        shift
done</code></pre>
<p>If you need to restore this mksysb, you just have to register it as a NIM object, then register the client on the NIM master and do the restore as normal.</p>
{"id":529,"date":"2010-08-26T14:20:56","date_gmt":"2010-08-26T18:20:56","guid":{"rendered":"http:\/\/patrickv.info\/wordpress\/?p=529"},"modified":"2010-08-26T14:20:56","modified_gmt":"2010-08-26T18:20:56","slug":"mksysb-backups-w-nim","status":"publish","type":"post","link":"https:\/\/rootuser.ninja\/index.php\/2010\/08\/26\/mksysb-backups-w-nim\/","title":{"rendered":"mksysb Backups w\/ NIM"},"content":{"rendered":"<p>NIM is great for backing up systems and pushing out packages, but there isn&#8217;t a included system for managing mksysb images. &nbsp;I&#8217;ve got a little script that runs on the NIM server and either does a mksysb on all the clients registered or you can specify certain clients. &nbsp;It also keeps X number of old mksysb images and purges the remaining ones. &nbsp;It&#8217;s needs a little cosmetic work, but you can use it as a basis for your own system.<\/p>\n<p><a href='http:\/\/patrickv.info\/wordpress\/wp-content\/uploads\/2010\/08\/get_mksysb.txt'>get_mksysb<\/a><\/p>\n<p>Now, since you have NIM working, you really should run a mksysb backup to tape so you have bootable media to get your NIM server back up. &nbsp;I have two of them, which happen to also be my TSM servers, that I also backup to eachother. &nbsp;Since you can&#8217;t have your NIM master be a client on another NIM server, I have a little script that generates a mksysb on disk (plus any extra VGs) and uses scp to copy the images to the other server.  It&#8217;s stupid simple, and could use come cosmetics, but it works:<\/p>\n<pre><code>#!\/bin\/ksh\n# Usage: mksysb.ksh dest_hostname [ extra_vg ... ]\n\nhostname=`hostname`\ndest_host=$1\n\nshift\n\nscp_file() {\n        \/usr\/bin\/scp $1 $dest_host:\/export\/mksysb\/$hostname\/\n\n}\n\n\n\/usr\/bin\/mksysb -e -i -X \/shared\/mksysb.$hostname\n\nif [ $? -eq 0 ]\nthen\n        scp_file \/shared\/mksysb.$hostname \nelse\n        echo \"mksysb backup failed!\"\n        exit 1\nfi\n\nif [ $? -eq 0 ]\nthen\n        rm \/shared\/mksysb.$hostname\nfi\n\nwhile [ \"$1\" != \"\" ]\ndo\n        savevg -f \/shared\/$1.savevg $1\n        if [ $? -eq 0 ]\n        then\n                scp_file \/shared\/$1.savevg\n                rm \/shared\/$1.savevg\n        else\n                echo \"savevg of $1 failed!\"\n                exit 1\n        fi\n        shift\ndone<\/code><\/pre>\n<p>If you need to restore this mksysb, you just have to register it as a NIM object, then register the client on the NIM master and do the restore as normal.<\/p>\n","protected":false},"excerpt":{"rendered":null,"protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,1],"tags":[],"class_list":["post-529","post","type-post","status-publish","format-standard","hentry","category-aix-notes","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/rootuser.ninja\/index.php\/wp-json\/wp\/v2\/posts\/529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rootuser.ninja\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rootuser.ninja\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rootuser.ninja\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rootuser.ninja\/index.php\/wp-json\/wp\/v2\/comments?post=529"}],"version-history":[{"count":0,"href":"https:\/\/rootuser.ninja\/index.php\/wp-json\/wp\/v2\/posts\/529\/revisions"}],"wp:attachment":[{"href":"https:\/\/rootuser.ninja\/index.php\/wp-json\/wp\/v2\/media?parent=529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rootuser.ninja\/index.php\/wp-json\/wp\/v2\/categories?post=529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rootuser.ninja\/index.php\/wp-json\/wp\/v2\/tags?post=529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}