Skip to content

Instantly share code, notes, and snippets.

@pguth66
Created February 27, 2013 07:09
Show Gist options
  • Save pguth66/5045866 to your computer and use it in GitHub Desktop.
Save pguth66/5045866 to your computer and use it in GitHub Desktop.
exporting SS metadata
#!/bin/sh
dstamp=`date "+%F-%T"`
bkupdir=/var/tmp/$0-$dstamp
mkdir -p $bkupdir && cd $bkupdir
for d in zone block machine device zone_design block_design machine_design
do
echo -n "backing up $d records..."
ocs $d list | grep -v ID | sort | uniq | grep -v "^ *$" | cut -f 3 -d " " | while read f ; do
ocs $d show $f > $d.$f
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment