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:
parent
14600652bf
commit
3eeb67662d
18
xCAT-server/share/xcat/scripts/xcat_db_backup.sh
Executable file
18
xCAT-server/share/xcat/scripts/xcat_db_backup.sh
Executable 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
|
||||
|
13
xCAT-server/share/xcat/scripts/xcat_db_restore.sh
Executable file
13
xCAT-server/share/xcat/scripts/xcat_db_restore.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user