Created xcat_db_backup and xcat_db_restore scripts.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2136 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
sikorsky 2008-09-10 21:26:25 +00:00
parent 14600652bf
commit 3eeb67662d
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#!/bin/sh
#-- script backs up xCAT database to csv files into (newly created) directory
#-- jurij.sikorsky@t-systems.cz
basedir=/scratch/xcat/backup
dirname=$basename/xcatdb-`hostname`-`date +%y%m%d-%H%M%S`
echo $dirname
mkdir $dirname
cd $dirname
for tab in `/opt/xcat/sbin/tabdump`; do
echo $tab
tabdump $tab > $tab.csv
done
cd - > /dev/null

View File

@ -0,0 +1,13 @@
#!/bin/sh
#-- script restores xCAT database from directory with csv files,
#-- created by xcat_db_backup.sh script
#-- jurij.sikorsky@t-systems.cz
dirname=$1
if [[ -z $dirname ]]; then echo "Usage: $0 {backup dir}"; exit 1; fi
for tab in $dirname/*.csv; do
echo $tab
tabrestore $tab
done