Print additional infos about errors to std_out.
This commit is contained in:
		| @@ -41,6 +41,12 @@ echononl(){ | |||||||
|    fi |    fi | ||||||
|    rm /tmp/shprompt$$ |    rm /tmp/shprompt$$ | ||||||
| } | } | ||||||
|  |  | ||||||
|  | print_error_stdout() { | ||||||
|  |    echo -e -n "\n   Host:  ${srcHost}\n   Error: $*" 1>&2 | ||||||
|  |    echo "" | ||||||
|  | } | ||||||
|  |  | ||||||
| # | # | ||||||
| # | # | ||||||
| fatal(){ | fatal(){ | ||||||
|   | |||||||
| @@ -212,6 +212,7 @@ if $MIRROR ;then | |||||||
|       if [ "$retval" = "24" ]; then |       if [ "$retval" = "24" ]; then | ||||||
|          echolog "\t[ Notice ] \"$real_backupSrcDir\": \n\t`$cat $err_Log`\n" |          echolog "\t[ Notice ] \"$real_backupSrcDir\": \n\t`$cat $err_Log`\n" | ||||||
|       else |       else | ||||||
|  |          print_error_stdout "Cannot mirror directory \"$real_backupSrcDir\"\n          $(cat "$err_Log")" | ||||||
|          echolog "\t[ERROR] Cannot mirror directory \"$real_backupSrcDir\"  [ $duration ]\n\t`$cat $err_Log`\n" |          echolog "\t[ERROR] Cannot mirror directory \"$real_backupSrcDir\"  [ $duration ]\n\t`$cat $err_Log`\n" | ||||||
|       fi |       fi | ||||||
|    else |    else | ||||||
|   | |||||||
| @@ -111,6 +111,7 @@ for _disk in $disks ; do | |||||||
|       if [ "$retval" = "0" ]; then |       if [ "$retval" = "0" ]; then | ||||||
|          echolog "\t--- \"info_${_disk}.txt\"  successfully saved ---" |          echolog "\t--- \"info_${_disk}.txt\"  successfully saved ---" | ||||||
|       else |       else | ||||||
|  |          print_error_stdout "Cannot save identification info for disk $disk:\n          $(cat $err_Log)" | ||||||
|          echolog "\t[ERROR] Cannot save identification info for disk $disk: \n\t`$cat $err_Log`\n" |          echolog "\t[ERROR] Cannot save identification info for disk $disk: \n\t`$cat $err_Log`\n" | ||||||
|       fi |       fi | ||||||
|    fi |    fi | ||||||
| @@ -158,6 +159,7 @@ for _disk in $disks ; do | |||||||
|          if [ "$retval" = "0" ]; then |          if [ "$retval" = "0" ]; then | ||||||
|             echolog "\t--- \"fdisk_${_disk}.txt\"  successfully saved ---" |             echolog "\t--- \"fdisk_${_disk}.txt\"  successfully saved ---" | ||||||
|          else |          else | ||||||
|  |             print_error_stdout "Cannot save partition tables for $disk (info file):\n          $(cat $err_Log)" | ||||||
|             echolog "\t[ERROR] Cannot save partition tables for $disk (info file): \n\t`$cat $err_Log`\n" |             echolog "\t[ERROR] Cannot save partition tables for $disk (info file): \n\t`$cat $err_Log`\n" | ||||||
|          fi |          fi | ||||||
|       fi |       fi | ||||||
| @@ -185,6 +187,7 @@ for _disk in $disks ; do | |||||||
|          if [ "$retval" = "0" ]; then |          if [ "$retval" = "0" ]; then | ||||||
|             echolog "\t--- \"${_disk}.mbr\"  successfully saved ---" |             echolog "\t--- \"${_disk}.mbr\"  successfully saved ---" | ||||||
|          else |          else | ||||||
|  |             print_error_stdout "Cannot save master boot record of disk $disk:\n          $(cat $err_Log)" | ||||||
|             echolog "\t[ERROR] Cannot save master boot record of disk $disk: \n\t`$cat $err_Log`\n" |             echolog "\t[ERROR] Cannot save master boot record of disk $disk: \n\t`$cat $err_Log`\n" | ||||||
|          fi |          fi | ||||||
|       else |       else | ||||||
| @@ -214,6 +217,7 @@ for _disk in $disks ; do | |||||||
|          if [ "$retval" = "0" ]; then |          if [ "$retval" = "0" ]; then | ||||||
|             echolog "\t--- \"${_disk}-partitions.sfdisk\"  successfully saved ---" |             echolog "\t--- \"${_disk}-partitions.sfdisk\"  successfully saved ---" | ||||||
|          else |          else | ||||||
|  |             print_error_stdout "Cannot save partition table of disk $disk:\n          $(cat $err_Log)" | ||||||
|             echolog "\t[ERROR] Cannot save partition table of disk $disk: \n\t`$cat $err_Log`\n" |             echolog "\t[ERROR] Cannot save partition table of disk $disk: \n\t`$cat $err_Log`\n" | ||||||
|          fi |          fi | ||||||
|       else |       else | ||||||
| @@ -252,6 +256,7 @@ for _disk in $disks ; do | |||||||
|             if [ "$retval" = "0" ]; then |             if [ "$retval" = "0" ]; then | ||||||
|                echolog "\t--- \"boot_sec-${_part}.bin\"  successfully saved ---" |                echolog "\t--- \"boot_sec-${_part}.bin\"  successfully saved ---" | ||||||
|             else |             else | ||||||
|  |                print_error_stdout "Cannot save boot record of partition $partition:\n          $(cat $err_Log)" | ||||||
|                echolog "\t[ERROR] Cannot save boot record of partition $partition: \n\t`$cat $err_Log`\n" |                echolog "\t[ERROR] Cannot save boot record of partition $partition: \n\t`$cat $err_Log`\n" | ||||||
|             fi |             fi | ||||||
|          else |          else | ||||||
| @@ -294,6 +299,7 @@ for _disk in $disks ; do | |||||||
|          if [ "$retval" = "0" ]; then |          if [ "$retval" = "0" ]; then | ||||||
|             echolog "\t--- \"fdisk_${_disk}.txt\"  successfully saved ---" |             echolog "\t--- \"fdisk_${_disk}.txt\"  successfully saved ---" | ||||||
|          else |          else | ||||||
|  |             print_error_stdout "Cannot save partition tables for $disk (info file)\n          $(cat $err_Log)" | ||||||
|             echolog "\t[ERROR] Cannot save partition tables for $disk (info file): \n\t`$cat $err_Log`\n" |             echolog "\t[ERROR] Cannot save partition tables for $disk (info file): \n\t`$cat $err_Log`\n" | ||||||
|          fi |          fi | ||||||
|       fi |       fi | ||||||
| @@ -322,6 +328,7 @@ for _disk in $disks ; do | |||||||
|          if [ "$retval" = "0" ]; then |          if [ "$retval" = "0" ]; then | ||||||
|             echolog "\t--- \"${_disk}-partitions.sgdisk\"  successfully saved ---" |             echolog "\t--- \"${_disk}-partitions.sgdisk\"  successfully saved ---" | ||||||
|          else |          else | ||||||
|  |             print_error_stdout "Cannot save partition table of disk $disk: \n          $(cat $err_Log)" | ||||||
|             echolog "\t[ERROR] Cannot save partition table of disk $disk: \n\t`$cat $err_Log`\n" |             echolog "\t[ERROR] Cannot save partition table of disk $disk: \n\t`$cat $err_Log`\n" | ||||||
|          fi |          fi | ||||||
|       else |       else | ||||||
|   | |||||||
| @@ -118,24 +118,56 @@ fi | |||||||
| # ------------------ Ende Variable ------------------ # | # ------------------ Ende Variable ------------------ # | ||||||
| # --------------------------------------------------- # | # --------------------------------------------------- # | ||||||
|  |  | ||||||
|     | err_msg="Determin existing databases failed"  | ||||||
| if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then | if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then | ||||||
|    if [ -n "$mysql_credential_args" ] ; then |    if [ -n "$mysql_credential_args" ] ; then | ||||||
|       DATABASES=`$ssh ${ssh_user}@$srcHost "$mysql $mysql_credential_args -N -s -e \"show databases\""` |       DATABASES="$($ssh ${ssh_user}@$srcHost "$mysql $mysql_credential_args -N -s -e \"show databases\"" 2> $err_Log)" | ||||||
|       MYSQL_VERSION=`$ssh ${ssh_user}@$srcHost "$mysql $mysql_credential_args -N -s -e \"SELECT VERSION()\""` |       retval=$? | ||||||
|    else |    else | ||||||
|       DATABASES=`$ssh ${ssh_user}@$srcHost "$mysql -u$mysql_user -p$mysql_password -N -s -e \"show databases\""` |       DATABASES="$($ssh ${ssh_user}@$srcHost "$mysql -u$mysql_user -p$mysql_password -N -s -e \"show databases\"" 2> $err_Log)" | ||||||
|       MYSQL_VERSION=`$ssh ${ssh_user}@$srcHost "$mysql -u$mysql_user -p$mysql_password -N -s -e \"SELECT VERSION()\""` |       retval=$? | ||||||
|    fi |    fi | ||||||
| else | else | ||||||
|    if [ -n "$mysql_credential_args" ] ; then |    if [ -n "$mysql_credential_args" ] ; then | ||||||
|       DATABASES=`$mysql $mysql_credential_args -N -s -e "show databases"` |       DATABASES="$($mysql $mysql_credential_args -N -s -e "show databases" 2> $err_Log)" | ||||||
|       MYSQL_VERSION=`$mysql $mysql_credential_args -N -s -e "SELECT VERSION()"` |       retval=$? | ||||||
|    else |    else | ||||||
|       DATABASES=`$mysql -u$mysql_user -p$mysql_password -N -s -e "show databases"` |       DATABASES="$($mysql -u$mysql_user -p$mysql_password -N -s -e "show databases" 2> $err_Log)" | ||||||
|       MYSQL_VERSION=`$mysql -u$mysql_user -p$mysql_password -N -s -e "SELECT VERSION()"` |       retval=$? | ||||||
|    fi |    fi | ||||||
| fi | fi | ||||||
|  | if [ "$retval" != "0" ]; then | ||||||
|  |    print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|  |    echolog "" | ||||||
|  |    echolog "\t[ERROR] ${err_msg}\n\t        $(cat $err_Log)\n" | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | err_msg="Determine version information about MySQL/MariaDB failed."  | ||||||
|  | if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then | ||||||
|  |    if [ -n "$mysql_credential_args" ] ; then | ||||||
|  |       MYSQL_VERSION="$($ssh ${ssh_user}@$srcHost "$mysql $mysql_credential_args -N -s -e \"SELECT VERSION()\"" 2> $err_Log)" | ||||||
|  |       retval=$? | ||||||
|  |    else | ||||||
|  |       MYSQL_VERSION=`$ssh ${ssh_user}@$srcHost "$mysql -u$mysql_user -p$mysql_password -N -s -e \"SELECT VERSION()\""` | ||||||
|  |       retval=$? | ||||||
|  |    fi | ||||||
|  | else | ||||||
|  |    if [ -n "$mysql_credential_args" ] ; then | ||||||
|  |       MYSQL_VERSION="$($mysql $mysql_credential_args -N -s -e "SELECT VERSION()" 2> $err_Log)" | ||||||
|  |       retval=$? | ||||||
|  |    else | ||||||
|  |       MYSQL_VERSION="$($mysql -u$mysql_user -p$mysql_password -N -s -e "SELECT VERSION()" 2> $err_Log)" | ||||||
|  |       retval=$? | ||||||
|  |    fi | ||||||
|  | fi | ||||||
|  | if [ "$retval" != "0" ]; then | ||||||
|  |    print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|  |    echolog "" | ||||||
|  |    echolog "\t[ERROR] ${err_msg}\n\t        $(cat $err_Log)\n" | ||||||
|  | fi | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| MYSQL_VERSION_NUM=`echo $MYSQL_VERSION | awk -F \. '{ printf "%02d", $1; printf "%02d", $2; printf "%02d", $3 }'` | MYSQL_VERSION_NUM=`echo $MYSQL_VERSION | awk -F \. '{ printf "%02d", $1; printf "%02d", $2; printf "%02d", $3 }'` | ||||||
|  |  | ||||||
| @@ -164,6 +196,7 @@ if $ARCHIVE ;then | |||||||
|    ## ----------------------------- |    ## ----------------------------- | ||||||
|    ## - Backup SQL Grants for users |    ## - Backup SQL Grants for users | ||||||
|    ## -  |    ## -  | ||||||
|  |    found_errors=false | ||||||
|    info_msg="save SQL Grants for users" |    info_msg="save SQL Grants for users" | ||||||
|    echononl "\t$info_msg" |    echononl "\t$info_msg" | ||||||
|  |  | ||||||
| @@ -244,6 +277,7 @@ if $ARCHIVE ;then | |||||||
|    ## - look about errors.. |    ## - look about errors.. | ||||||
|    ## - |    ## - | ||||||
|    if [ "$retval" != "0" ]; then |    if [ "$retval" != "0" ]; then | ||||||
|  |       print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|       echolog "" |       echolog "" | ||||||
|       echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" |       echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | ||||||
|       if ! $keep_backup_on_error ; then |       if ! $keep_backup_on_error ; then | ||||||
| @@ -362,6 +396,7 @@ if $ARCHIVE ;then | |||||||
| 			## - look about errors.. | 			## - look about errors.. | ||||||
| 			## - | 			## - | ||||||
| 			if [ "$retval" != "0" ]; then | 			if [ "$retval" != "0" ]; then | ||||||
|  |             print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
| 				echolog "" | 				echolog "" | ||||||
| 				echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | 				echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | ||||||
| 				if ! $keep_backup_on_error ; then | 				if ! $keep_backup_on_error ; then | ||||||
| @@ -472,6 +507,7 @@ if $ARCHIVE ;then | |||||||
| 			## - look about errors.. | 			## - look about errors.. | ||||||
| 			## - | 			## - | ||||||
| 			if [ "$retval" != "0" ]; then | 			if [ "$retval" != "0" ]; then | ||||||
|  |             print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
| 				echolog "" | 				echolog "" | ||||||
| 				echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | 				echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | ||||||
| 				if ! $keep_backup_on_error ; then | 				if ! $keep_backup_on_error ; then | ||||||
| @@ -583,6 +619,7 @@ if $ARCHIVE ;then | |||||||
|          ## - look about errors.. |          ## - look about errors.. | ||||||
|          ## - |          ## - | ||||||
|          if [ "$retval" != "0" ]; then |          if [ "$retval" != "0" ]; then | ||||||
|  |             print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|             echolog "" |             echolog "" | ||||||
|             echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" |             echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | ||||||
|             if ! $keep_backup_on_error ; then |             if ! $keep_backup_on_error ; then | ||||||
| @@ -696,6 +733,7 @@ if $ARCHIVE ;then | |||||||
|       ## - look about errors.. |       ## - look about errors.. | ||||||
|       ## - |       ## - | ||||||
|       if [ "$retval" != "0" ]; then |       if [ "$retval" != "0" ]; then | ||||||
|  |          print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|          echolog "" |          echolog "" | ||||||
|          echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" |          echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | ||||||
|          if ! $keep_backup_on_error ; then |          if ! $keep_backup_on_error ; then | ||||||
| @@ -805,6 +843,7 @@ if $ARCHIVE ;then | |||||||
|       ## - look about errors.. |       ## - look about errors.. | ||||||
|       ## - |       ## - | ||||||
|       if [ "$retval" != "0" ]; then |       if [ "$retval" != "0" ]; then | ||||||
|  |          print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|          echolog "" |          echolog "" | ||||||
|          echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" |          echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | ||||||
|          if ! $keep_backup_on_error ; then |          if ! $keep_backup_on_error ; then | ||||||
| @@ -900,6 +939,7 @@ if $ARCHIVE ;then | |||||||
|    ## - look about errors.. |    ## - look about errors.. | ||||||
|    ## - |    ## - | ||||||
|    if [ "$retval" != "0" ]; then |    if [ "$retval" != "0" ]; then | ||||||
|  |       print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|       echolog "" |       echolog "" | ||||||
|       echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" |       echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | ||||||
|       if ! $keep_backup_on_error ; then |       if ! $keep_backup_on_error ; then | ||||||
| @@ -1047,6 +1087,7 @@ if $ARCHIVE ;then | |||||||
|          ## - look about errors.. |          ## - look about errors.. | ||||||
|          ## - |          ## - | ||||||
|          if [ "$retval" != "0" ]; then |          if [ "$retval" != "0" ]; then | ||||||
|  |             print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|             echolog "" |             echolog "" | ||||||
|             echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" |             echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | ||||||
|             if ! $keep_backup_on_error ; then |             if ! $keep_backup_on_error ; then | ||||||
| @@ -1198,6 +1239,7 @@ if $ARCHIVE ;then | |||||||
|       ## - look about errors.. |       ## - look about errors.. | ||||||
|       ## - |       ## - | ||||||
|       if [ "$retval" != "0" ]; then |       if [ "$retval" != "0" ]; then | ||||||
|  |          print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|          echolog "" |          echolog "" | ||||||
|          echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" |          echolog "\t[ERROR] ${err_msg}  [  $duration ]\n\t`$cat $err_Log`\n" | ||||||
|          if ! $keep_backup_on_error ; then |          if ! $keep_backup_on_error ; then | ||||||
|   | |||||||
| @@ -19,6 +19,8 @@ | |||||||
|     |     | ||||||
| if $mount_netdir ; then | if $mount_netdir ; then | ||||||
|    if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then |    if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then | ||||||
|  |       print_error_stdout "Mounting network directories is only possible for localhost - yet:\n          $(cat $err_Log)" | ||||||
|  |       echolog "" | ||||||
|       echolog "\t[ERROR] Mounting network directories is only possible for localhost - yet" |       echolog "\t[ERROR] Mounting network directories is only possible for localhost - yet" | ||||||
|       exit 1 |       exit 1 | ||||||
|    else |    else | ||||||
| @@ -31,6 +33,8 @@ if $mount_netdir ; then | |||||||
|       sleep 5 |       sleep 5 | ||||||
|  |  | ||||||
|       if ! df | grep "$backup_dir" > /dev/null 2>&1 ;then |       if ! df | grep "$backup_dir" > /dev/null 2>&1 ;then | ||||||
|  |          print_error_stdout "Cannot mount network directory to \"$backup_dir\":\n          $(cat $err_Log)" | ||||||
|  |          echolog "" | ||||||
|          echolog "\t[ERROR] Cannot mount network directory to \"$backup_dir\"" |          echolog "\t[ERROR] Cannot mount network directory to \"$backup_dir\"" | ||||||
|          exit 1 |          exit 1 | ||||||
|       fi |       fi | ||||||
| @@ -49,6 +53,8 @@ backup_dir=$backup_dir $script_dir/dir_backup.sh | |||||||
|        |        | ||||||
| if $mount_netdir ; then | if $mount_netdir ; then | ||||||
|    if [ $srcHost != "localhost" ];then |    if [ $srcHost != "localhost" ];then | ||||||
|  |       print_error_stdout "Mounting network directories is only possible for localhost - yet:\n          $(cat $err_Log)" | ||||||
|  |       echolog "" | ||||||
|       echolog "\t[ERROR] Mounting network directories is only possible for localhost - yet" |       echolog "\t[ERROR] Mounting network directories is only possible for localhost - yet" | ||||||
|       exit 1 |       exit 1 | ||||||
|    else |    else | ||||||
|   | |||||||
| @@ -54,11 +54,21 @@ if [ -z "$pg_dump" ]; then | |||||||
|    pg_dump="/usr/local/pgsql/bin/pg_dump" |    pg_dump="/usr/local/pgsql/bin/pg_dump" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | err_msg="Determin existing databases failed" | ||||||
| if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then | if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then | ||||||
|    DATABASES=`$ssh ${ssh_user}@$srcHost "$sudo -u $pgsql_user $psql  -lt" \ |  | ||||||
|       | $grep -v -e"^$" | $awk '{print$1}'`  |    DATABASES="$($ssh ${ssh_user}@$srcHost "$sudo -u $pgsql_user $psql  -lt" \ | ||||||
|  |       | $grep -v -e"^$" | $awk '{print$1}' 2> /tmp/error)" | ||||||
|  |    retval=$? | ||||||
|  |  | ||||||
| else | else | ||||||
|    DATABASES=`$su - $pgsql_user -c "$psql  -lt" | $grep -v -e"^$" | $awk '{print$1}'` |    DATABASES="$($su - $pgsql_user -c "$psql  -lt" | $grep -v -e"^$" | $awk '{print$1}' 2> /tmp/error)" | ||||||
|  |    retval=$? | ||||||
|  | fi | ||||||
|  | if [ "$retval" != "0" ]; then | ||||||
|  |    print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|  |    echolog "" | ||||||
|  |    echolog "\t[ERROR] ${err_msg}\n\t        $(cat $err_Log)\n" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -131,6 +141,7 @@ if $ARCHIVE ;then | |||||||
|    ## - look about errors.. |    ## - look about errors.. | ||||||
|    ## - |    ## - | ||||||
|    if [ "$retval" != "0" ]; then |    if [ "$retval" != "0" ]; then | ||||||
|  |       print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|       echolog "" |       echolog "" | ||||||
|       echolog "\t[ERROR] ${err_msg}  [ $duration ]\n\t`$cat $err_Log`\n" |       echolog "\t[ERROR] ${err_msg}  [ $duration ]\n\t`$cat $err_Log`\n" | ||||||
|       if ! $keep_backup_on_error ; then |       if ! $keep_backup_on_error ; then | ||||||
| @@ -223,6 +234,7 @@ if $ARCHIVE ;then | |||||||
|    ## - look about errors.. |    ## - look about errors.. | ||||||
|    ## - |    ## - | ||||||
|    if [ "$retval" != "0" ]; then |    if [ "$retval" != "0" ]; then | ||||||
|  |       print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|       echolog "" |       echolog "" | ||||||
|       echolog "\t[ERROR] ${err_msg}  [ $duration ]\n\t`$cat $err_Log`\n" |       echolog "\t[ERROR] ${err_msg}  [ $duration ]\n\t`$cat $err_Log`\n" | ||||||
|       if ! $keep_backup_on_error ; then |       if ! $keep_backup_on_error ; then | ||||||
| @@ -324,6 +336,7 @@ if $ARCHIVE ;then | |||||||
|       ## - look about errors.. |       ## - look about errors.. | ||||||
|       ## - |       ## - | ||||||
|       if [ "$retval" != "0" ]; then |       if [ "$retval" != "0" ]; then | ||||||
|  |          print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|          echolog "" |          echolog "" | ||||||
|          echolog "\t[ERROR] ${err_msg}  [ $duration ]\n\t`$cat $err_Log`\n" |          echolog "\t[ERROR] ${err_msg}  [ $duration ]\n\t`$cat $err_Log`\n" | ||||||
|          if ! $keep_backup_on_error ; then |          if ! $keep_backup_on_error ; then | ||||||
|   | |||||||
| @@ -57,11 +57,25 @@ fi | |||||||
| # ------------------ Ende Variable ------------------ # | # ------------------ Ende Variable ------------------ # | ||||||
| # --------------------------------------------------- # | # --------------------------------------------------- # | ||||||
|  |  | ||||||
|  | err_msg="Determin existing SVN repositories failed" | ||||||
| if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then | if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then | ||||||
|    _REPOSITORIES=`ssh ${ssh_user}@$srcHost "$sudo $find $svn_source_base_path -maxdepth 1 -type d -exec basename 'realpath {}' \;"` |    #_REPOSITORIES=`ssh ${ssh_user}@$srcHost "$sudo $find $svn_source_base_path -maxdepth 1 -type d -exec basename 'realpath {}' \;"` | ||||||
|  |  | ||||||
|  |    _REPOSITORIES="$(ssh ${ssh_user}@$srcHost "$sudo $find $svn_source_base_path -maxdepth 1 -type d -exec basename 'realpath {}' \;" 2> /tmp/error)" | ||||||
|  |    retval=$? | ||||||
|  |  | ||||||
| else | else | ||||||
|    _REPOSITORIES=`find $svn_source_base_path -maxdepth 1 -type d -exec basename 'realpath {}' \;` |    #_REPOSITORIES=`find $svn_source_base_path -maxdepth 1 -type d -exec basename 'realpath {}' \;` | ||||||
|  |  | ||||||
|  |    _REPOSITORIES="$(find $svn_source_base_path -maxdepth 1 -type d -exec basename 'realpath {}' \; 2> /tmp/error)" | ||||||
|  |    retval=$? | ||||||
| fi | fi | ||||||
|  | if [ "$retval" != "0" ]; then | ||||||
|  |    print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|  |    echolog "" | ||||||
|  |    echolog "\t[ERROR] ${err_msg}\n\t        $(cat $err_Log)\n" | ||||||
|  | fi | ||||||
|  |  | ||||||
|  |  | ||||||
| for repos in $_REPOSITORIES ; do | for repos in $_REPOSITORIES ; do | ||||||
|    _dir=`basename $svn_source_base_path` |    _dir=`basename $svn_source_base_path` | ||||||
| @@ -142,6 +156,7 @@ if $ARCHIVE ;then | |||||||
|       ## - look about errors.. |       ## - look about errors.. | ||||||
|       ## - |       ## - | ||||||
|       if [ "$retval" != "0" ]; then |       if [ "$retval" != "0" ]; then | ||||||
|  |          print_error_stdout "${err_msg}:\n          $(cat $err_Log)" | ||||||
|          echolog "" |          echolog "" | ||||||
|          echolog "\t[ERROR] ${err_msg}  [ $duration ]\n\t`$cat $err_Log`\n" |          echolog "\t[ERROR] ${err_msg}  [ $duration ]\n\t`$cat $err_Log`\n" | ||||||
|          if ! $keep_backup_on_error ; then |          if ! $keep_backup_on_error ; then | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								rcopy.sh
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								rcopy.sh
									
									
									
									
									
								
							| @@ -237,6 +237,7 @@ fi | |||||||
| ## - | ## - | ||||||
| if $manual ; then | if $manual ; then | ||||||
|    host_scripts="${hosts_base_dir}/localhost.sh" |    host_scripts="${hosts_base_dir}/localhost.sh" | ||||||
|  |    host_scripts="${hosts_base_dir}/srv-cityslang.cityslang.com.sh" | ||||||
| else | else | ||||||
|    host_scripts=`$find  $hosts_base_dir -maxdepth 1 -type f -perm -700 | $sort` |    host_scripts=`$find  $hosts_base_dir -maxdepth 1 -type f -perm -700 | $sort` | ||||||
| fi | fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user