From: Kern Sibbald Date: Thu, 15 Apr 2004 10:14:26 +0000 (+0000) Subject: Update mtx-changer script to make it backward compatible X-Git-Tag: Release-1.34.1~54 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=542f33722d84449b08be8bfaf361216bafe69795;p=bacula%2Fbacula Update mtx-changer script to make it backward compatible git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1199 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/ChangeLog b/bacula/ChangeLog index ed9bfd6628..b6b338a6ab 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,9 +1,35 @@ +13Apr04 +- Fix crash in query command. +- Remove schedule from the default restore job. +- Fix data spooler to use min/max tape blocking factors. +- Automatically turn of conio if library not found instead of bombing. +- Cleaned up a lot of copyright dates. +- Try to keep spool statistics from going negative. +- Integrated wx-console code from Nicolas Boichat. +09Apr04 +- Added new Pools chapter. Doc about using two disks. +- Attempt to keep the spool file statistics size from going + negative. +-8Apr04 +- Fix the Director's Scheduled Jobs: list to have a === + termination. +- Fixed ./configure to disable readline rather than stop if + readline.h is not found +- Fixed a typo in the SQLite database update script as reported + by Robert J. Clark - thanks. +07Apr04 +- Removed src/win32/pthreads and src/win32/zlib from the source + tree. +- Created a new depkgs-win32 that has the pthreads and zlib source + code. +- Removed the JobDefs from the default Restore job as it has a + schedule. Thanks to Matt Howard for this. 2004-04-06 Version 1.34.0 06Apr04 Release 06Apr04 -- Turn of SIGQUIT in console. +- Turn off SIGQUIT in console. 05Apr04 - A good number of document updates. - Fixed the order which multiple files are accepted for diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index f6ce8e0905..807e8fd718 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,15 +1,34 @@ Release Notes for Bacula 1.34.1 - Bacula code: Total files = 306 Total lines = 91,131 (*.h *.c *.in) + Bacula code: Total files = 306 Total lines = 91,155 (*.h *.c *.in) Changes for 1.34.1: - Autochanger users, please note you must add %d to the end of the changer command line in your Device resource in your bacula-sd.conf file. -- Fixed a crash in the query command. -- Removed the schedule from the default restore job. - +- Fix data spooler to use min/max tape blocking factors. +- Automatically turn of conio if library not found instead of bombing. +- Cleaned up a lot of copyright dates. +- Try to keep spool statistics from going negative. +- Added new Pools chapter. Doc about using two disks. +- Attempt to keep the spool file statistics size from going + negative. +- Fix the Director's Scheduled Jobs: list to have a === + termination. +- Fixed ./configure to disable readline rather than stop if + readline.h is not found +- Fixed a typo in the SQLite database update script as reported + by Robert J. Clark - thanks. +- Removed src/win32/pthreads and src/win32/zlib from the source + tree. +- Created a new depkgs-win32 that has the pthreads and zlib source + code. +- Removed the JobDefs from the default Restore job as it has a + schedule. Thanks to Matt Howard for this. + + + Release 1.34.0 Major Features: - Data spooling which reduces tape shoe-shine during Inc backups, diff --git a/bacula/scripts/mtx-changer.in b/bacula/scripts/mtx-changer.in index c5d202cc34..3e59e86907 100644 --- a/bacula/scripts/mtx-changer.in +++ b/bacula/scripts/mtx-changer.in @@ -29,18 +29,64 @@ MTX=@MTX@ -case "$2" in +if test $# -lt 2 ; then + echo "usage: mtx-changer ctl-device command slot archive-device drive" + echo " Insufficient number of arguments arguments given." + echo " Mimimum usage is first two arguments ..." + exit 1 +fi + +# Setup arguments +ctl=$1 +cmd="$2" +slot=$3 +device=$4 +# If drive not given, default to 0 +if test $# = 5 ; then + drive=$5 +else + drive=0 +fi + +# +# Check for special cases where only 2 arguments are needed, +# all others are a minimum of 3 +case $cmd in + loaded) + ;; + unload) + ;; + list) + ;; + slots) + ;; + *) + if test $# -lt 3; then + echo "usage: mtx-changer ctl-device command slot archive-device drive" + echo " Insufficient number of arguments arguments given." + echo " Mimimum usage is first three arguments ..." + exit 1 + fi + ;; +esac + + +case $cmd in unload) -# echo "Doing mtx -f $1 unload $3 $5" +# echo "Doing mtx -f $ctl unload $slot $drive" # # enable the following line if you need to eject the cartridge -# mt -f $4 offline - ${MTX} -f $1 unload $3 $5 +# mt -f $device offline + if test x$slot = x; then + ${MTX} -f $ctl unload + else + ${MTX} -f $ctl unload $slot $drive + fi ;; load) -# echo "Doing mtx -f $1 load $3 $5" - ${MTX} -f $1 load $3 $5 +# echo "Doing mtx -f $ctl load $slot $drive" + ${MTX} -f $ctl load $slot $drive rtn=$? # # Increase the sleep time if you have a slow device @@ -50,20 +96,20 @@ case "$2" in list) # echo "Requested list" - ${MTX} -f $1 status | grep " *Storage Element [0-9]*:.*Full" | awk "{print \$3 \$4}" | sed "s/Full *\(:VolumeTag=\)*//" + ${MTX} -f $ctl status | grep " *Storage Element [0-9]*:.*Full" | awk "{print \$slot \$device}" | sed "s/Full *\(:VolumeTag=\)*//" ;; loaded) - ${MTX} -f $1 status >/tmp/mtx.$$ + ${MTX} -f $ctl status >/tmp/mtx.$$ rtn=$? - cat /tmp/mtx.$$ | grep "^Data Transfer Element $5:Full" | awk "{print \$7}" - cat /tmp/mtx.$$ | grep "^Data Transfer Element $5:Empty" | awk "{print 0}" + cat /tmp/mtx.$$ | grep "^Data Transfer Element $drive:Full" | awk "{print \$7}" + cat /tmp/mtx.$$ | grep "^Data Transfer Element $drive:Empty" | awk "{print 0}" rm -f /tmp/mtx.$$ exit $rtn ;; slots) # echo "Request slots" - ${MTX} -f $1 status | grep " *Storage Changer" | awk "{print \$5}" + ${MTX} -f $ctl status | grep " *Storage Changer" | awk "{print \$drive}" ;; esac diff --git a/bacula/src/lib/bnet_pkt.c b/bacula/src/lib/bnet_pkt.c index 5de132b419..a803866c3c 100644 --- a/bacula/src/lib/bnet_pkt.c +++ b/bacula/src/lib/bnet_pkt.c @@ -26,6 +26,7 @@ */ +#ifdef implemented #include "bacula.h" @@ -148,3 +149,5 @@ bnet_send_pkt(BSOCK *bsock, BPKT *pkt, int version) } ser_end(bsock->msg, 0); } + +#endif diff --git a/bacula/src/lib/bshm.c b/bacula/src/lib/bshm.c index ed65fce4d2..0632904813 100644 --- a/bacula/src/lib/bshm.c +++ b/bacula/src/lib/bshm.c @@ -39,6 +39,8 @@ */ +#ifdef implemented + #include "bacula.h" #if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32) @@ -149,3 +151,5 @@ void shm_destroy(BSHM *shm) } #endif /* ! HAVE_CYGWIN */ + +#endif