|
|
@ -45,8 +45,8 @@ Usage:
|
|
|
|
{NAME} find [--catalog=<path>] [--format=<fmt>]
|
|
|
|
{NAME} find [--catalog=<path>] [--format=<fmt>]
|
|
|
|
[-aBCbdVs] [--path=<path>] [<term>]
|
|
|
|
[-aBCbdVs] [--path=<path>] [<term>]
|
|
|
|
{NAME} index [--catalog=<path>] [--meta=<meta>...]
|
|
|
|
{NAME} index [--catalog=<path>] [--meta=<meta>...]
|
|
|
|
[-aBCcfnV] <name> <path>
|
|
|
|
[-aBCcfV] <name> <path>
|
|
|
|
{NAME} update [--catalog=<path>] [-aBCcfnV]
|
|
|
|
{NAME} update [--catalog=<path>] [-aBCcfV]
|
|
|
|
[--lpath=<path>] <name> <path>
|
|
|
|
[--lpath=<path>] <name> <path>
|
|
|
|
{NAME} mount [--catalog=<path>] [-V] <mountpoint>
|
|
|
|
{NAME} mount [--catalog=<path>] [-V] <mountpoint>
|
|
|
|
{NAME} rm [--catalog=<path>] [-BCfV] <storage>
|
|
|
|
{NAME} rm [--catalog=<path>] [-BCfV] <storage>
|
|
|
@ -70,7 +70,6 @@ Options:
|
|
|
|
-F --format=<fmt> see \"print_supported_formats\" [default: native].
|
|
|
|
-F --format=<fmt> see \"print_supported_formats\" [default: native].
|
|
|
|
-f --force Do not ask when updating the catalog [default: False].
|
|
|
|
-f --force Do not ask when updating the catalog [default: False].
|
|
|
|
-l --lpath=<path> Path where changes are logged [default: ]
|
|
|
|
-l --lpath=<path> Path where changes are logged [default: ]
|
|
|
|
-n --no-subsize Do not store size of directories [default: False].
|
|
|
|
|
|
|
|
-p --path=<path> Start path.
|
|
|
|
-p --path=<path> Start path.
|
|
|
|
-r --recursive Recursive [default: False].
|
|
|
|
-r --recursive Recursive [default: False].
|
|
|
|
-s --raw-size Print raw size [default: False].
|
|
|
|
-s --raw-size Print raw size [default: False].
|
|
|
@ -106,7 +105,6 @@ def cmd_index(args: Dict[str, Any],
|
|
|
|
name = args['<name>']
|
|
|
|
name = args['<name>']
|
|
|
|
usehash = args['--hash']
|
|
|
|
usehash = args['--hash']
|
|
|
|
debug = args['--verbose']
|
|
|
|
debug = args['--verbose']
|
|
|
|
subsize = not args['--no-subsize']
|
|
|
|
|
|
|
|
if not os.path.exists(path):
|
|
|
|
if not os.path.exists(path):
|
|
|
|
Logger.err(f'\"{path}\" does not exist')
|
|
|
|
Logger.err(f'\"{path}\" does not exist')
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -119,15 +117,15 @@ def cmd_index(args: Dict[str, Any],
|
|
|
|
Logger.err('aborted')
|
|
|
|
Logger.err('aborted')
|
|
|
|
return
|
|
|
|
return
|
|
|
|
node = top.get_storage_node()
|
|
|
|
node = top.get_storage_node()
|
|
|
|
node.parent = None
|
|
|
|
if node:
|
|
|
|
|
|
|
|
node.parent = None
|
|
|
|
|
|
|
|
|
|
|
|
start = datetime.datetime.now()
|
|
|
|
start = datetime.datetime.now()
|
|
|
|
walker = Walker(noder, usehash=usehash, debug=debug)
|
|
|
|
walker = Walker(noder, usehash=usehash, debug=debug)
|
|
|
|
attr = args['--meta']
|
|
|
|
attr = args['--meta']
|
|
|
|
root = noder.new_storage_node(name, path, top, attr)
|
|
|
|
root = noder.new_storage_node(name, path, top, attr)
|
|
|
|
_, cnt = walker.index(path, root, name)
|
|
|
|
_, cnt = walker.index(path, root, name)
|
|
|
|
if subsize:
|
|
|
|
root.nodesize = root.get_rec_size()
|
|
|
|
root.nodesize = root.get_rec_size()
|
|
|
|
|
|
|
|
stop = datetime.datetime.now()
|
|
|
|
stop = datetime.datetime.now()
|
|
|
|
diff = stop - start
|
|
|
|
diff = stop - start
|
|
|
|
Logger.info(f'Indexed {cnt} file(s) in {diff}')
|
|
|
|
Logger.info(f'Indexed {cnt} file(s) in {diff}')
|
|
|
@ -145,7 +143,6 @@ def cmd_update(args: Dict[str, Any],
|
|
|
|
usehash = args['--hash']
|
|
|
|
usehash = args['--hash']
|
|
|
|
logpath = args['--lpath']
|
|
|
|
logpath = args['--lpath']
|
|
|
|
debug = args['--verbose']
|
|
|
|
debug = args['--verbose']
|
|
|
|
subsize = not args['--no-subsize']
|
|
|
|
|
|
|
|
if not os.path.exists(path):
|
|
|
|
if not os.path.exists(path):
|
|
|
|
Logger.err(f'\"{path}\" does not exist')
|
|
|
|
Logger.err(f'\"{path}\" does not exist')
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -158,8 +155,7 @@ def cmd_update(args: Dict[str, Any],
|
|
|
|
walker = Walker(noder, usehash=usehash, debug=debug,
|
|
|
|
walker = Walker(noder, usehash=usehash, debug=debug,
|
|
|
|
logpath=logpath)
|
|
|
|
logpath=logpath)
|
|
|
|
cnt = walker.reindex(path, storage, top)
|
|
|
|
cnt = walker.reindex(path, storage, top)
|
|
|
|
if subsize:
|
|
|
|
storage.nodesize = storage.get_rec_size()
|
|
|
|
storage.nodesize = storage.get_rec_size()
|
|
|
|
|
|
|
|
stop = datetime.datetime.now()
|
|
|
|
stop = datetime.datetime.now()
|
|
|
|
diff = stop - start
|
|
|
|
diff = stop - start
|
|
|
|
Logger.info(f'updated {cnt} file(s) in {diff}')
|
|
|
|
Logger.info(f'updated {cnt} file(s) in {diff}')
|
|
|
|