@@ -0,0 +1,777 @@
+from json import load, dump%0A%0Adef walk_and_filter(tree, drive_id):%0A    # Shallow copy tree%0A    new_tree = dict(tree)%0A    new_tree%5B'files'%5D = %7B%7D%0A    new_tree%5B'folders'%5D = %7B%7D%0A    for name, data in tree%5B'files'%5D.items():%0A        if data%5B'drive'%5D == drive_id:%0A            new_tree%5B'files'%5D%5Bname%5D = data%0A%0A    for name, data in tree%5B'folders'%5D.items():%0A        new_data = walk_and_filter(data, drive_id)%0A        if new_data%5B'files'%5D or new_data%5B'folders'%5D:%0A            new_tree%5B'folders'%5D%5Bname%5D = new_data%0A%0A    return new_tree%0A%0Adef main():%0A%0A    with open('backupbuffet.json') as bb_file:%0A        tree = load(bb_file)%0A%0A    new_tree = walk_and_filter(tree, 1)%0A%0A    with open('backupbuffet_1.json', 'w') as bb_file:%0A        dump(new_tree, bb_file)%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add consolidate script