X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fbacula%2Ffiles%2Fvolumes-delete-old;h=979e469297ac46bf223fec2d58fc4e54eb7e2525;hb=598ef097f4c8f6b50b61dde7fc4bd011e955b754;hp=b33e6d2d4f1c671d4f42f36a6ca7f87ef49e57c7;hpb=8871c2de1c24293538e59fe6ea7d299fbfebbbba;p=mirror%2Fdsa-puppet.git diff --git a/modules/bacula/files/volumes-delete-old b/modules/bacula/files/volumes-delete-old index b33e6d2d4..979e46929 100755 --- a/modules/bacula/files/volumes-delete-old +++ b/modules/bacula/files/volumes-delete-old @@ -2,7 +2,7 @@ # queries a bacula database for volumes to delete and deletes them using bconsole -# Copyright 2010, 2011, 2013, 2017 Peter Palfrader +# Copyright 2010, 2011, 2013, 2017, 2018 Peter Palfrader # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -49,6 +49,9 @@ parser.add_argument("-v", "--verbose", dest="verbose", parser.add_argument("-n", "--nodo", dest="nodo", default=False, action="store_true", help="Print to cat rather than bconsole.") +parser.add_argument("-t", "--token", metavar='TOKEN', dest="pool_name_token", + default='bacula', + help="A string token used in pool names.") args = parser.parse_args() if args.db is not None: @@ -130,7 +133,7 @@ if os.path.exists(args.clientlist): for r in cursor.fetchall(): poolname = r['name'] - match = re.match('pool[a-z]*-debian-(.*)', poolname) + match = re.match('pool[a-z]*-%s-(.*)'%(args.pool_name_token, ), poolname) if match is not None: hostname = match.group(1) if hostname not in clients: