Created
February 27, 2013 07:09
-
-
Save pguth66/5045866 to your computer and use it in GitHub Desktop.
exporting SS metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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