File indexing completed on 2024-09-08 03:28:58
0001 #!/bin/bash 0002 0003 # Script to generate data dumps for each trixel 0004 # 0005 # SPDX-FileCopyrightText: 2008 Akarsh Simha <akarshsimha@gmail.com> 0006 # SPDX-License-Identifier: GPL-2.0-or-later 0007 0008 # 0009 # USAGE: <this script> <DB username> <DB password> <file prefix> <DB name> <Table Name> <LOG File> 0010 # 0011 0012 MAX_TRIXEL=32767 0013 NOMADMYSQL2BIN_SPLIT='./nomadmysql2bin-split' 0014 DB_USER=$1 0015 DB_PASS=$2 0016 FILE_PREFIX=$3 0017 DB_NAME=$4 0018 TBL_NAME=$5 0019 LOGFILE=$6 0020 0021 for trixel in `seq 0 $MAX_TRIXEL`; do 0022 CMD="$NOMADMYSQL2BIN_SPLIT $DB_USER $DB_PASS $FILE_PREFIX$trixel $trixel $DB_NAME $TBL_NAME >> $LOGFILE" 0023 echo "Executing $CMD" >> $LOGFILE 0024 $CMD 0025 status=$? 0026 if [ $status -ne 0 ] ; then 0027 echo "***ERROR*** MySQL --> binary dump failed. $NOMADMYSQL2BIN_SPLIT exited with status: $status on trixel $trixel" 0028 echo "***ERROR*** MySQL --> binary dump failed. $NOMADMYSQL2BIN_SPLIT exited with status: $status on trixel $trixel" >> $LOGFILE 0029 else 0030 echo "=================== Trixel $trixel dumped successfully ===================" >> $LOGFILE 0031 fi; 0032 done; 0033 0034 0035