ArielGlenn has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/385200 )
Change subject: fix usage message printing and exit codes in separate 7z batch script ...................................................................... fix usage message printing and exit codes in separate 7z batch script Change-Id: I52a498423ac725c667c8c869012ba94dea3cd25b --- M xmldumps-backup/do_7z_jobs.sh 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dumps refs/changes/00/385200/1 diff --git a/xmldumps-backup/do_7z_jobs.sh b/xmldumps-backup/do_7z_jobs.sh index 53dc82d..57043bd 100755 --- a/xmldumps-backup/do_7z_jobs.sh +++ b/xmldumps-backup/do_7z_jobs.sh @@ -8,7 +8,7 @@ # does NOT: clean up old dumps, remove old files from run usage() { - echo<<EOF + cat<<EOF Usage: $0 --config <pathtofile> --wiki <dbname> --date <YYYYMMDD> --jobinfo num:num:num,... [--skiplock] [--dryrun] [--verbose] @@ -60,7 +60,7 @@ shift else echo "$0: Unknown option $1" - usage + usage && exit 1 fi done } @@ -68,7 +68,7 @@ check_opts() { if [ -z "$WIKI" -o -z "$JOBINFO" -o -z "$DATE" -o -z "$CONFIGFILE" -o -z "$NUMJOBS" ]; then echo "$0: Mandatory options 'wiki', 'jobinfo', 'date', 'numjobs' and 'config' must be specified" - usage + usage && exit 1 elif [ ! -f "$CONFIGFILE" ]; then echo "Could not find config file: $CONFIGFILE" echo "Exiting..." @@ -78,7 +78,7 @@ result=`date -d "$DATE"` if [ -z "$result" ]; then echo "bad date given for 'date' arg" - usage + usage && exit 1 fi } @@ -187,14 +187,14 @@ } WIKIDUMP_BASE=`dirname "$0"` -set_defaults -process_opts "$@" -check_opts +set_defaults || exit 1 +process_opts "$@" || exit 1 +check_opts || exit 1 IFS=',' read -a JOBARRAY <<< "$JOBINFO" if [ -z "$SKIPLOCK" ]; then - lockerup + lockerup || exit 1 fi -get_dumps_output_dir +get_dumps_output_dir || exit 1 for PARTNUM in ${JOBARRAY[*]}; do get_bz2files_completed do_recompression $NUMJOBS -- To view, visit https://gerrit.wikimedia.org/r/385200 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52a498423ac725c667c8c869012ba94dea3cd25b Gerrit-PatchSet: 1 Gerrit-Project: operations/dumps Gerrit-Branch: master Gerrit-Owner: ArielGlenn <ar...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits