diff --git a/backup.py b/backup.py index 6e2a3555a6887e22098a9486581675b82a10f367..bf5ceb541158e2d6d8e0054eabf84c21eef2a044 100755 --- a/backup.py +++ b/backup.py @@ -136,5 +136,12 @@ for image_key in images: if args.verbose: print '#============================================================' +# show borgbackup info +if args.verbose: + try: + print functions.borgbackup_info() + except Exception as ex: + print ex + # disconnect form 3PAR _3par.logout() diff --git a/functions.py b/functions.py index d6ba10e5474e230ab0f30562c79bbe0a9050276c..2f7611f03cea9deeea1f93a2e5d1fefb789633aa 100644 --- a/functions.py +++ b/functions.py @@ -1,3 +1,7 @@ +import subprocess +import config + + def bool_arg(string): if string != True and string != '1' and string != 'YES': return False @@ -122,3 +126,10 @@ def filter_images(all_images, datastores, args): return images return all_images + + +def borgbackup_info(): + try: + return subprocess.check_output('borg info %s' % (config.BACKUP_REPO), shell=True) + except subprocess.CalledProcessError as ex: + raise Exception('Can not issue borg info command on repo %s!' % (config.BACKUP_REPO), ex) \ No newline at end of file