X-Git-Url: http://gitweb.michael.orlitzky.com/?p=untangle-https-backup.git;a=blobdiff_plain;f=bin%2Funtangle-https-backup;fp=bin%2Funtangle-https-backup;h=25fbf9d2364a7b94242a3f9b540b8589f658c3f6;hp=1f6a2db3fcf671c27176aeff71d01f0fd52912cd;hb=04cae0dd1a7186272fc174bb68dc7e0f824a8794;hpb=a37d5cfa4fa2073e3cc3816ca5623b7a1b14d02f diff --git a/bin/untangle-https-backup b/bin/untangle-https-backup index 1f6a2db..25fbf9d 100755 --- a/bin/untangle-https-backup +++ b/bin/untangle-https-backup @@ -8,6 +8,7 @@ import configparser from http.client import HTTPException from os import chmod from urllib.error import HTTPError, URLError +from socket import timeout from sys import stderr from untangle.untangle import Untangle @@ -71,5 +72,12 @@ for section in config.sections(): msg = tpl.format(u.name, repr(e), u.host) print(msg, file=stderr) status = EXIT_BACKUPS_FAILED + except timeout as e: + # A socket.timeout exception occurs when something goes over + # the configured "timeout" limit. + tpl = '{:s}: socket timeout ({:s}) from {:s}' + msg = tpl.format(u.name, str(e), u.host) + print(msg, file=stderr) + status = EXIT_BACKUPS_FAILED exit(status)