示例#1
0
def snapshots():
    for s in settings.sections:
        x = Section(settings.config[s])
        if args.verbose:
            for i in x.snapshot_paths:
                print(i, 'from', x.subvolume)
        else:
            x.print_snapshots()
示例#2
0
def section_snapshots():
    s = args.section_snapshots.rstrip('/')
    x = Section(settings.config[s])
    if args.verbose:
        for i in x.snapshot_paths:
            print(i, 'from', x.subvolume)
    else:
        x.print_snapshots()
示例#3
0
def section_snapshots():
    for i in Snapman.args.targets:
        s = i.rstrip('/')
        x = Section(settings.config[s])
        if Snapman.args.verbose:
            for i in x.snapshot_paths:
                print(i, 'from', x.subvolume)
        else:
            x.print_snapshots()
示例#4
0
def subvolume_snapshots():
    sub = args.subvolume_snapshots
    if sub != '/':  # Prevent strip filesystem root.
        sub = sub.rstrip('/')

    found = False
    for i in settings.sections:
        if sub == settings.config[i]['subvolume']:
            found = True
            x = Section(settings.config[i])
            if not args.verbose:
                x.print_snapshots()
            else:
                for s in x.snapshot_paths:
                    print(s, 'from', x.subvolume)
    if not found:
        clean_exit('Currently there is no snapshot for the subvolume: ' +
                   sub, BADSUB)