#177 Issue closed: uncomplete restore with TSM

ghwk opened issue at 2012-11-12 14:50:

I've tried to restore my server with rear 1.14 (BACKUP=TSM)., Filesystems / /var and /boot.
First time / and /var was completely restored, but not /boot. Second time /var and /boot was completely restored, but not / (only some directories) See log.

I assume there is a problem in in 40_restore_with_tsm.sh

2012-11-09 13:23:25.749738301 Disk layout created.
2012-11-09 13:23:25.752299915 Including layout/recreate/default/25_verify_mount.sh
2012-11-09 13:23:25.756342785 Finished running 'layout/recreate' stage in 24 seconds
2012-11-09 13:23:25.758319398 Running 'restore' stage
2012-11-09 13:23:25.763718633 Including restore/TSM/default/40_restore_with_tsm.sh
2012-11-09 13:23:25.766037999 Restoring /
2012-11-09 13:23:25.768074969 Running 'dsmc restore /* /mnt/local// -verbose -subdir=yes -replace=all -tapeprompt=no '
/usr/share/rear/restore/TSM/default/40_restore_with_tsm.sh: line 16:  2424 Exit 12                 dsmc restore "${filespace}*" "/mnt/local/$filespace" -verbose -subdir=yes -replace=all -tapeprompt=no "${TSM_DSMC_RESTORE_OPTIONS[@]}"
      2425 Quit                    | while read Line; do
    if test "${Line:0:8}" == "ANS1898I"; then
        TsmProcessed="$(echo "${Line:9}" | tr -s '*') "; Line="Restoring";
    fi; if test "${Line:0:9}" == "Restoring"; then
        echo -n "$TsmProcessed"; star;
    else
        echo "$Line";
    fi;
done
2012-11-09 13:23:30.036246425 Restoring /boot/
2012-11-09 13:23:30.038327466 Running 'dsmc restore /boot/* /mnt/local//boot/ -verbose -subdir=yes -replace=all -tapeprompt=no '
2012-11-09 13:26:28.338489656 Restoring /var/
2012-11-09 13:26:28.340556280 Running 'dsmc restore /var/* /mnt/local//var/ -verbose -subdir=yes -replace=all -tapeprompt=no '
2012-11-09 13:44:27.820728893 Including restore/default/90_create_missing_directories.sh
2012-11-09 13:44:30.992764385 Including restore/SUSE_LINUX/91_create_missing_directories.sh
2012-11-09 13:44:30.996147058 Finished running 'restore' stage in 1265 seconds

gdha commented at 2012-11-15 13:35:

What does exit 12 mean in TSM?

ghwk commented at 2012-11-16 09:24:

Good question !

Return codes from the command line interface:
In general, the return code is related to the highest severity message during the client operation.

If the highest severity message is informational (ANSnnnnI), then the return code will be 0.
If the highest severity message is a warning (ANSnnnnW), then the return code will be 8.
If the highest severity message is an error (ANSnnnnE), then the return code will be 12.

Code 12:
The operation completed with at least one error message (except for error messages for skipped files). For scheduled events, the status will be Failed. Review the dsmerror.log file (and dsmsched.log file for scheduled events) to determine what error messages were issued and to assess their impact on the operation. As a general rule, this return code means that the error was severe enough to prevent the successful completion of the operation. For example, an error that prevents an entire file system from being processed yields return code 12. When a file is not found the operation yields return code 12.

I should have seen in the dsmerror.log.

Perhaps rear should not eat the dsmc error messages ?

dagwieers commented at 2012-11-16 10:37:

I agree, for restoring we should give as much information as possible to the user. If default output is sufficient, it could go to the terminal, otherwise it should be logged. (Maybe in this case default progress output could go to the log, and normal output to terminal).

Patches to make this better will be accepted.

ghwk commented at 2012-11-16 11:08:

Hello Dag,

I have looked at the code and found that I must have missed the message.
Probably because it was the first filespace and the following went
through without error.
What do you think of the proposal that rear breaks when dsmc failed. In
addition I have written a patch. The patch is not tested, because
actually I dont have access to a TSM environment.

Am 16.11.2012 11:37, schrieb Dag Wieers:

I agree, for restoring we should give as much information as possible
to the user. If default output is sufficient, it could go to the
terminal, otherwise it should be logged. (Maybe in this case default
progress output could go to the log, and normal output to terminal).

Patches to make this better will be accepted.


Reply to this email directly or view it on GitHub
https://github.com/rear/rear/issues/177#issuecomment-10443041.

ciao

Gerhard Weick ORDIX AG
Senior Consultant Kreuzberger Ring
65205 Wiesbaden
E-Mail gew@ordix.de
Internet: http://www.ordix.de
--- restore/TSM/default/40_restore_with_tsm.sh.orig 2012-11-16 09:51:58.000000000 +0100
+++ restore/TSM/default/40_restore_with_tsm.sh 2012-11-16 10:42:33.000000000 +0100
@@ -35,5 +35,15 @@
echo "$Line"
fi
done

  • DSMCSTATUS=$PIPESTATUS

  • [ $DSMCSTATUS -eq 12 ] &&

  • Error "'dsmc restore ${filespace}* /mnt/local/$filespace -verbose -subdir=yes -replace=all -tapeprompt=no ${TSM_DSMC_RESTORE_OPTIONS[@]}' failed."

  • [ $DSMCSTATUS -eq 8 ] && {

  • LogPrint "restoring ${filespace} completed with at least one warning message. Review dsmerror.log"

  • }

  • [ $DSMCSTATUS -eq 4 ] && {

  • LogPrint "restoring ${filespace} completed successfully, but some files were not processed. There were no other errors or warnings."

  • }

  • done

gdha commented at 2012-11-16 15:14:

I would prefer that you first test your enhancement of the code before we add it (to avoid broken code). And, it would be even better to make it available as a pull request.
Thanks for the troubleshooting.

gdha commented at 2013-12-03 12:18:

no feedback received - we mark this issue as dead. Re-open it if required.


[Export of Github issue for rear/rear.]