[Box Backup-commit] #78: Error level for "bbackupquery.exe -u"

Trac trac at boxbackup.org
Tue May 15 02:51:29 BST 2012


#78: Error level for "bbackupquery.exe -u"
-----------------------+---------------------
  Reporter:  achim     |      Owner:  ben
      Type:  defect    |     Status:  new
  Priority:  normal    |  Milestone:
 Component:  bbackupd  |    Version:  0.11rc2
Resolution:            |   Keywords:
-----------------------+---------------------

Comment (by achim):

 Well, it turns out that not only %ERRORLEVEL% is broken, effectively any
 kind of cmd magic does not work anymore after running a bbackupquery.exe
 instance with the "-u" switch:

 This works:

 {{{
 "%~dp0\\bbackupquery.exe" -q -c %1 "compare -a -q -c" quit >
 %temp%\compare_backup_output.txt 2>&1
 REM IF ERRORLEVEL 2 (
 FOR %%F IN (%temp%\compare_backup_output.txt) DO IF %%~zF NEQ 0 (
         echo Comparison failed with error: %errorlevel%
         type "%temp%\compare_backup_output.txt"
         exit /b %errorlevel%
 )

 }}}

 This does not (only change: passing "-u" to bbackupquery.exe:


 {{{
 "%~dp0\\bbackupquery.exe" -u -q -c %1 "compare -a -q -c" quit >
 %temp%\compare_backup_output.txt 2>&1
 REM IF ERRORLEVEL 2 (
 FOR %%F IN (%temp%\compare_backup_output.txt) DO IF %%~zF NEQ 0 (
         echo Comparison failed with error: %errorlevel%
         type "%temp%\compare_backup_output.txt"
         exit /b %errorlevel%
 )

 }}}

 The first .cmd shows the differences between local and remote, if the file
 size of the resulting "diff" output from bbackupquery.exe is > 0. The
 second example should achieve the same (and respect non-ASCII characters),
 but it always stops after the line with bbackupquery.exe: no other
 commands are executed after that.

 For fun, insert a line with only "notepad.exe" before the FOR loop: it
 gets executed every time in the first cmd, never in the second!

 You can see that I originally thought that only the ERRORLEVEL comparison
 was broken (hence I came up with the size comparison hack...), but even
 that does not work because it appears as if bbackupquery.exe breaks
 something with the -u switch in cmd.exe.

-- 
Ticket URL: <https://www.boxbackup.org/ticket/78#comment:1>
Box Backup <http://www.boxbackup.org/>
An open source, completely automatic on-line backup system for UNIX.



More information about the Boxbackup-commit mailing list