diff options
Diffstat (limited to 'z-distfiles/scripts-gw-1.1/SVN-mysql')
-rwxr-xr-x | z-distfiles/scripts-gw-1.1/SVN-mysql | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/z-distfiles/scripts-gw-1.1/SVN-mysql b/z-distfiles/scripts-gw-1.1/SVN-mysql index 5c0d6c2..cf20b22 100755 --- a/z-distfiles/scripts-gw-1.1/SVN-mysql +++ b/z-distfiles/scripts-gw-1.1/SVN-mysql @@ -1,34 +1,20 @@ #!/bin/bash -if [ "x$1" == "x--help" ]; then - echo "Usage: SVN-mysql /backup/dir mysql-root-pass \"commit message\"" - echo - echo "Dumps all mysql databases into the given /backup/dir/mysql" - echo "and subsequently performs a \"svn commit\". So the " - echo "backup dir has to be a checkout from an svn repository." - exit 0 -fi +LOGFILE=/root/.log/cronlog +ERRFILE=/root/.log/errlog +BASEDIR=/root/opt/backup/mysql/ -LOGFILE=${1}/cronlog -ERRFILE=${1}/errlog -BASEDIR=${1}/mysql/ +/bin/rm $LOGFILE +/bin/rm $ERRFILE -if [ ! -d "${BASEDIR}" ]; then - mkdir -p $BASEDIR - cd ${1} && svn add mysql -fi +/bin/date >> $LOGFILE +/bin/date >> $ERRFILE -date > $LOGFILE -date > $ERRFILE +/usr/bin/mysqldump -u root -p4H6e4p6p --all-databases > $BASEDIR/mysql.dump -mysql-dump-all ${2} $BASEDIR - -MESSAGE="$3" +MESSAGE="$1" [ ! "$MESSAGE" ] && MESSAGE="Automatic Update" -cd $BASEDIR >> $LOGFILE 2>> $ERRFILE && svn commit -m "$MESSAGE" >> $LOGFILE 2>> $ERRFILE +cd $BASEDIR >> $LOGFILE 2>> $ERRFILE && /usr/bin/svn commit -m "$MESSAGE" >> $LOGFILE 2>> $ERRFILE cat $LOGFILE cat $ERRFILE - -rm $LOGFILE -rm $ERRFILE |