Univention Bugzilla – Attachment 10081 Details for
Bug 49399
Add Diagnostic check for tdb errors in sam.ldb.d/*
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Refactor all error on exit in script
0002-Bug-49399-refactoring-all-exits-on-error.patch (text/plain), 2.25 KB, created by
Fathan Vidjaja
on 2019-06-24 13:05:40 CEST
(
hide
)
Description:
Refactor all error on exit in script
Filename:
MIME Type:
Creator:
Fathan Vidjaja
Created:
2019-06-24 13:05:40 CEST
Size:
2.25 KB
patch
obsolete
>From c478cc7de04a75b496ea6bd9c8c6be9097ad5fde Mon Sep 17 00:00:00 2001 >From: Fathan Vidjaja <vidjaja@univention.de> >Date: Mon, 17 Jun 2019 14:44:33 +0200 >Subject: [PATCH 2/2] Bug #49399: refactoring all exits on error > >--- > .../sbin/univention-samba4-backup | 20 +++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > >diff --git a/services/univention-samba4/sbin/univention-samba4-backup b/services/univention-samba4/sbin/univention-samba4-backup >index 4ae652a5ab..0955cf1149 100755 >--- a/services/univention-samba4/sbin/univention-samba4-backup >+++ b/services/univention-samba4/sbin/univention-samba4-backup >@@ -73,6 +73,11 @@ display_help() { > EOL > } > >+terminate_on_error() { >+ >&2 echo "$*" >+ exit 1 >+} >+ > FROMWHERE=/var/lib/samba > WHERE=/var/univention-backup/samba > DAYS="" >@@ -112,13 +117,11 @@ while [ $# -gt 0 ]; do > done > > if [ ! -d $WHERE ]; then >- echo "Missing backup directory $WHERE" >- exit 1 >+ terminate_on_error "Missing backup directory $WHERE" > fi > > if [ ! -d $FROMWHERE ]; then >- echo "Missing or wrong provision directory $FROMWHERE" >- exit 1 >+ terminate_on_error "Missing or wrong provision directory $FROMWHERE" > fi > > cd $FROMWHERE >@@ -137,8 +140,7 @@ for d in $DIRS; do > tdbbackup $file > Status=$? > if [ $Status -ne 0 ]; then >- >&2 echo "Error while backing up $file with tdbbackup - status $Status" >- exit 1 >+ terminate_on_error "Error while backing up $file with tdbbackup - status $Status" > fi > fi > done >@@ -157,8 +159,7 @@ for d in $DIRS; do > Status=$? > if [ $Status -ne 0 -a $Status -ne 1 ]; then > # Ignore 1 - private dir is always changing. >- echo "Error while archiving ${WHERE}/samba4_${n}.${WHEN}.tar.bz2 - status = $Status" >- exit 1 >+ terminate_on_error "Error while archiving ${WHERE}/samba4_${n}.${WHEN}.tar.bz2 - status = $Status" > fi > for db in tdb ldb; do > find $relativedirname -name "*.$db.bak" -exec rm {} \; >@@ -173,8 +174,7 @@ for d in $DIRS; do > Status=$? > if [ $Status -ne 0 -a $Status -ne 1 ]; then > # Ignore 1 - sysvol may change >- echo "Error while archiving ${WHERE}/${n}.${WHEN}.tar.bz2 - status = $Status" >- exit 1 >+ terminate_on_error "Error while archiving ${WHERE}/${n}.${WHEN}.tar.bz2 - status = $Status" > fi > fi > done >-- >2.17.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 49399
:
10058
| 10081