question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

Name option no longer works

See original GitHub issue

Describe the bug Name option no longer works

Expected behavior check should pass with the name option set

Environment (please complete the following information):

  • OS: Garuda Linux
  • Output of organize --version: organize, version 2.2.0

Your config file

# organize configuration file
# https://organize.readthedocs.io

rules:
    - name: Scripts
    - locations:
          - path: ~/
      filters:
          - extension:
            - sh
      actions:
          - move: 
                dest: ~/Scripts/

Log

organize check
Checking: /home/zany130/.config/organize/config.yaml
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /usr/lib/python3.10/site-packages/schema.py:405 in validate                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   402 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   skey.handler(nkey, data, e)                                โ”‚
โ”‚   403 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   else:                                                          โ”‚
โ”‚   404 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   try:                                                       โ”‚
โ”‚ โฑ 405 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   nvalue = Schema(svalue, error=e, ignore_extra_keys=i   โ”‚
โ”‚   406 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   except SchemaError as x:                                   โ”‚
โ”‚   407 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   k = "Key '%s' error:" % nkey                           โ”‚
โ”‚   408 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   message = self._prepend_schema_name(k)                 โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /usr/lib/python3.10/site-packages/schema.py:366 in validate                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   363 โ”‚   โ”‚   if flavor == ITERABLE:                                                             โ”‚
โ”‚   364 โ”‚   โ”‚   โ”‚   data = Schema(type(s), error=e).validate(data, **kwargs)                       โ”‚
โ”‚   365 โ”‚   โ”‚   โ”‚   o = Or(*s, error=e, schema=Schema, ignore_extra_keys=i)                        โ”‚
โ”‚ โฑ 366 โ”‚   โ”‚   โ”‚   return type(data)(o.validate(d, **kwargs) for d in data)                       โ”‚
โ”‚   367 โ”‚   โ”‚   if flavor == DICT:                                                                 โ”‚
โ”‚   368 โ”‚   โ”‚   โ”‚   exitstack = ExitStack()                                                        โ”‚
โ”‚   369 โ”‚   โ”‚   โ”‚   data = Schema(dict, error=e).validate(data, **kwargs)                          โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /usr/lib/python3.10/site-packages/schema.py:366 in <genexpr>                                     โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   363 โ”‚   โ”‚   if flavor == ITERABLE:                                                             โ”‚
โ”‚   364 โ”‚   โ”‚   โ”‚   data = Schema(type(s), error=e).validate(data, **kwargs)                       โ”‚
โ”‚   365 โ”‚   โ”‚   โ”‚   o = Or(*s, error=e, schema=Schema, ignore_extra_keys=i)                        โ”‚
โ”‚ โฑ 366 โ”‚   โ”‚   โ”‚   return type(data)(o.validate(d, **kwargs) for d in data)                       โ”‚
โ”‚   367 โ”‚   โ”‚   if flavor == DICT:                                                                 โ”‚
โ”‚   368 โ”‚   โ”‚   โ”‚   exitstack = ExitStack()                                                        โ”‚
โ”‚   369 โ”‚   โ”‚   โ”‚   data = Schema(dict, error=e).validate(data, **kwargs)                          โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /usr/lib/python3.10/site-packages/schema.py:167 in validate                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   164 โ”‚   โ”‚   โ”‚   except SchemaError as _x:                                                      โ”‚
โ”‚   165 โ”‚   โ”‚   โ”‚   โ”‚   autos += _x.autos                                                          โ”‚
โ”‚   166 โ”‚   โ”‚   โ”‚   โ”‚   errors += _x.errors                                                        โ”‚
โ”‚ โฑ 167 โ”‚   โ”‚   raise SchemaError(                                                                 โ”‚
โ”‚   168 โ”‚   โ”‚   โ”‚   ["%r did not validate %r" % (self, data)] + autos,                             โ”‚
โ”‚   169 โ”‚   โ”‚   โ”‚   [self._error.format(data) if self._error else None] + errors,                  โ”‚
โ”‚   170 โ”‚   โ”‚   )                                                                                  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
SchemaError: Or({Optional('name'): <class 'str'>, Optional('enabled'): <class 'bool'>, Optional('subfolders'): <class 'bool'>, Optional('filter_mode'): Or('all', 'any', 'none'), Optional('tags'): Or(<class 'str'>,
[<class 'str'>]), Optional('targets'): Or('dirs', 'files'), 'locations': Or(<class 'str'>, [Or(<class 'str'>, {'path': And(<class 'str'>, <built-in function len>), Optional('max_depth'): Or(<class 'int'>, None),
Optional('search'): Or('depth', 'breadth'), Optional('exclude_files'): Or(<class 'str'>, [<class 'str'>]), Optional('exclude_dirs'): Or(<class 'str'>, [<class 'str'>]), Optional('system_exclude_files'): Or(<class
'str'>, [<class 'str'>]), Optional('system_exclude_dirs'): Or(<class 'str'>, [<class 'str'>]), Optional('filter'): Or(<class 'str'>, [<class 'str'>]), Optional('filter_dirs'): Or(<class 'str'>, [<class 'str'>]),
Optional('ignore_errors'): <class 'bool'>, Optional('filesystem'): <class 'object'>})]), Optional('filters'): [Optional(Or(Schema(Or('not created', 'created')), {Schema(Or('not created', 'created')):
{Optional('mode'): Or('older', 'newer'), Optional('years'): <class 'int'>, Optional('months'): <class 'int'>, Optional('weeks'): <class 'int'>, Optional('days'): <class 'int'>, Optional('hours'): <class 'int'>,
Optional('minutes'): <class 'int'>, Optional('seconds'): <class 'int'>}})), Optional(Or(Schema(Or('not date_added', 'date_added')), {Schema(Or('not date_added', 'date_added')): {Optional('mode'): Or('older',
'newer'), Optional('years'): <class 'int'>, Optional('months'): <class 'int'>, Optional('weeks'): <class 'int'>, Optional('days'): <class 'int'>, Optional('hours'): <class 'int'>, Optional('minutes'): <class
'int'>, Optional('seconds'): <class 'int'>}})), Optional(Or(Schema(Or('not duplicate', 'duplicate')), {Schema(Or('not duplicate', 'duplicate')): Or(<class 'str'>, [<class 'str'>], Schema({}))})),
Optional(Schema(Or('not empty', 'empty'))), Optional(Or(Schema(Or('not exif', 'exif')), {Schema(Or('not exif', 'exif')): Or(<class 'str'>, [<class 'str'>], Schema({}))})), Optional(Or(Schema(Or('not extension',
'extension')), {Schema(Or('not extension', 'extension')): Or(<class 'str'>, [<class 'str'>], Schema({}))})), Optional(Or(Schema(Or('not filecontent', 'filecontent')), {Schema(Or('not filecontent', 'filecontent')):
Or(<class 'str'>, [<class 'str'>], Schema({}))})), Optional(Or(Schema(Or('not hash', 'hash')), {Schema(Or('not hash', 'hash')): Or(<class 'str'>, [<class 'str'>], Schema({}))})), Optional(Or(Schema(Or('not name',
'name')), {Schema(Or('not name', 'name')): Or(<class 'str'>, {Optional('match'): <class 'str'>, Optional('startswith'): Or(<class 'str'>, [<class 'str'>]), Optional('contains'): Or(<class 'str'>, [<class 'str'>]),
Optional('endswith'): Or(<class 'str'>, [<class 'str'>]), Optional('case_sensitive'): <class 'bool'>})})), Optional(Or(Schema(Or('not size', 'size')), {Schema(Or('not size', 'size')): Or(<class 'object'>, [<class
'object'>])})), Optional(Or(Schema(Or('not lastmodified', 'lastmodified')), {Schema(Or('not lastmodified', 'lastmodified')): {Optional('mode'): Or('older', 'newer'), Optional('years'): <class 'int'>,
Optional('months'): <class 'int'>, Optional('weeks'): <class 'int'>, Optional('days'): <class 'int'>, Optional('hours'): <class 'int'>, Optional('minutes'): <class 'int'>, Optional('seconds'): <class 'int'>}})),
Optional(Or(Schema(Or('not mimetype', 'mimetype')), {Schema(Or('not mimetype', 'mimetype')): Or(<class 'str'>, [<class 'str'>], Schema({}))})), Optional({Schema(Or('not python', 'python')): Or(<class 'str'>,
{'code': <class 'str'>})}), Optional({Schema(Or('not regex', 'regex')): <class 'str'>})], 'actions': [Optional(Or('confirm', {'confirm': Or(<class 'str'>, {Optional('msg'): <class 'str'>, Optional('default'):
<class 'bool'>})})), Optional({'copy': Or(<class 'str'>, {'dest': <class 'str'>, Optional('on_conflict'): Or('skip', 'overwrite', 'trash', 'rename_new', 'rename_existing'), Optional('rename_template'): <class
'str'>, Optional('filesystem'): <class 'object'>})}), Optional('delete'), Optional({'echo': <class 'str'>}), Optional({'macos_tags': Or(<class 'str'>, [<class 'str'>])}), Optional({'move': Or(<class 'str'>,
{'dest': <class 'str'>, Optional('on_conflict'): Or('skip', 'overwrite', 'trash', 'rename_new', 'rename_existing'), Optional('rename_template'): <class 'str'>, Optional('filesystem'): <class 'object'>})}),
Optional({'python': Or(<class 'str'>, {'code': <class 'str'>, Optional('run_in_simulation'): <class 'bool'>})}), Optional({'rename': Or(<class 'str'>, {'name': <class 'str'>, Optional('on_conflict'): Or('skip',
'overwrite', 'trash', 'rename_new', 'rename_existing'), Optional('rename_template'): <class 'str'>})}), Optional({'shell': Or(<class 'str'>, {'cmd': <class 'str'>, Optional('run_in_simulation'): <class 'bool'>,
Optional('ignore_errors'): <class 'bool'>, Optional('simulation_output'): <class 'str'>, Optional('simulation_returncode'): <class 'int'>})}), Optional({'symlink': Or(<class 'str'>, [<class 'str'>], Schema({}))}),
Optional('trash')]}) did not validate {'name': 'Scripts'}
Missing keys: 'actions', 'locations'

During handling of the above exception, another exception occurred:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /usr/lib/python3.10/site-packages/organize/cli.py:254 in check                                   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   251 โ”‚   โ”‚   โ”‚   out.print("\n\n")                                                              โ”‚
โ”‚   252 โ”‚   โ”‚   โ”‚   out.rule("Schema validation", align="left")                                    โ”‚
โ”‚   253 โ”‚   โ”‚                                                                                      โ”‚
โ”‚ โฑ 254 โ”‚   โ”‚   validate(rules)                                                                    โ”‚
โ”‚   255 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   256 โ”‚   โ”‚   if debug:                                                                          โ”‚
โ”‚   257 โ”‚   โ”‚   โ”‚   out.print("Validation ok.")                                                    โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /usr/lib/python3.10/site-packages/organize/config.py:103 in validate                             โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   100                                                                                            โ”‚
โ”‚   101                                                                                            โ”‚
โ”‚   102 def validate(config: dict):                                                                โ”‚
โ”‚ โฑ 103 โ”‚   return CONFIG_SCHEMA.validate(config)                                                  โ”‚
โ”‚   104                                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /usr/lib/python3.10/site-packages/schema.py:409 in validate                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   406 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   except SchemaError as x:                                   โ”‚
โ”‚   407 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   k = "Key '%s' error:" % nkey                           โ”‚
โ”‚   408 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   message = self._prepend_schema_name(k)                 โ”‚
โ”‚ โฑ 409 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   raise SchemaError([message] + x.autos, [e.format(dat   โ”‚
โ”‚   410 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   else:                                                      โ”‚
โ”‚   411 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   new[nkey] = nvalue                                     โ”‚
โ”‚   412 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   coverage.add(skey)                                     โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
SchemaError: 'organize rule configuration' Key 'rules' error:
Or({Optional('name'): <class 'str'>, Optional('enabled'): <class 'bool'>, Optional('subfolders'): <class 'bool'>, Optional('filter_mode'): Or('all', 'any', 'none'), Optional('tags'): Or(<class 'str'>, [<class
'str'>]), Optional('targets'): Or('dirs', 'files'), 'locations': Or(<class 'str'>, [Or(<class 'str'>, {'path': And(<class 'str'>, <built-in function len>), Optional('max_depth'): Or(<class 'int'>, None),
Optional('search'): Or('depth', 'breadth'), Optional('exclude_files'): Or(<class 'str'>, [<class 'str'>]), Optional('exclude_dirs'): Or(<class 'str'>, [<class 'str'>]), Optional('system_exclude_files'): Or(<class
'str'>, [<class 'str'>]), Optional('system_exclude_dirs'): Or(<class 'str'>, [<class 'str'>]), Optional('filter'): Or(<class 'str'>, [<class 'str'>]), Optional('filter_dirs'): Or(<class 'str'>, [<class 'str'>]),
Optional('ignore_errors'): <class 'bool'>, Optional('filesystem'): <class 'object'>})]), Optional('filters'): [Optional(Or(Schema(Or('not created', 'created')), {Schema(Or('not created', 'created')):
{Optional('mode'): Or('older', 'newer'), Optional('years'): <class 'int'>, Optional('months'): <class 'int'>, Optional('weeks'): <class 'int'>, Optional('days'): <class 'int'>, Optional('hours'): <class 'int'>,
Optional('minutes'): <class 'int'>, Optional('seconds'): <class 'int'>}})), Optional(Or(Schema(Or('not date_added', 'date_added')), {Schema(Or('not date_added', 'date_added')): {Optional('mode'): Or('older',
'newer'), Optional('years'): <class 'int'>, Optional('months'): <class 'int'>, Optional('weeks'): <class 'int'>, Optional('days'): <class 'int'>, Optional('hours'): <class 'int'>, Optional('minutes'): <class
'int'>, Optional('seconds'): <class 'int'>}})), Optional(Or(Schema(Or('not duplicate', 'duplicate')), {Schema(Or('not duplicate', 'duplicate')): Or(<class 'str'>, [<class 'str'>], Schema({}))})),
Optional(Schema(Or('not empty', 'empty'))), Optional(Or(Schema(Or('not exif', 'exif')), {Schema(Or('not exif', 'exif')): Or(<class 'str'>, [<class 'str'>], Schema({}))})), Optional(Or(Schema(Or('not extension',
'extension')), {Schema(Or('not extension', 'extension')): Or(<class 'str'>, [<class 'str'>], Schema({}))})), Optional(Or(Schema(Or('not filecontent', 'filecontent')), {Schema(Or('not filecontent', 'filecontent')):
Or(<class 'str'>, [<class 'str'>], Schema({}))})), Optional(Or(Schema(Or('not hash', 'hash')), {Schema(Or('not hash', 'hash')): Or(<class 'str'>, [<class 'str'>], Schema({}))})), Optional(Or(Schema(Or('not name',
'name')), {Schema(Or('not name', 'name')): Or(<class 'str'>, {Optional('match'): <class 'str'>, Optional('startswith'): Or(<class 'str'>, [<class 'str'>]), Optional('contains'): Or(<class 'str'>, [<class 'str'>]),
Optional('endswith'): Or(<class 'str'>, [<class 'str'>]), Optional('case_sensitive'): <class 'bool'>})})), Optional(Or(Schema(Or('not size', 'size')), {Schema(Or('not size', 'size')): Or(<class 'object'>, [<class
'object'>])})), Optional(Or(Schema(Or('not lastmodified', 'lastmodified')), {Schema(Or('not lastmodified', 'lastmodified')): {Optional('mode'): Or('older', 'newer'), Optional('years'): <class 'int'>,
Optional('months'): <class 'int'>, Optional('weeks'): <class 'int'>, Optional('days'): <class 'int'>, Optional('hours'): <class 'int'>, Optional('minutes'): <class 'int'>, Optional('seconds'): <class 'int'>}})),
Optional(Or(Schema(Or('not mimetype', 'mimetype')), {Schema(Or('not mimetype', 'mimetype')): Or(<class 'str'>, [<class 'str'>], Schema({}))})), Optional({Schema(Or('not python', 'python')): Or(<class 'str'>,
{'code': <class 'str'>})}), Optional({Schema(Or('not regex', 'regex')): <class 'str'>})], 'actions': [Optional(Or('confirm', {'confirm': Or(<class 'str'>, {Optional('msg'): <class 'str'>, Optional('default'):
<class 'bool'>})})), Optional({'copy': Or(<class 'str'>, {'dest': <class 'str'>, Optional('on_conflict'): Or('skip', 'overwrite', 'trash', 'rename_new', 'rename_existing'), Optional('rename_template'): <class
'str'>, Optional('filesystem'): <class 'object'>})}), Optional('delete'), Optional({'echo': <class 'str'>}), Optional({'macos_tags': Or(<class 'str'>, [<class 'str'>])}), Optional({'move': Or(<class 'str'>,
{'dest': <class 'str'>, Optional('on_conflict'): Or('skip', 'overwrite', 'trash', 'rename_new', 'rename_existing'), Optional('rename_template'): <class 'str'>, Optional('filesystem'): <class 'object'>})}),
Optional({'python': Or(<class 'str'>, {'code': <class 'str'>, Optional('run_in_simulation'): <class 'bool'>})}), Optional({'rename': Or(<class 'str'>, {'name': <class 'str'>, Optional('on_conflict'): Or('skip',
'overwrite', 'trash', 'rename_new', 'rename_existing'), Optional('rename_template'): <class 'str'>})}), Optional({'shell': Or(<class 'str'>, {'cmd': <class 'str'>, Optional('run_in_simulation'): <class 'bool'>,
Optional('ignore_errors'): <class 'bool'>, Optional('simulation_output'): <class 'str'>, Optional('simulation_returncode'): <class 'int'>})}), Optional({'symlink': Or(<class 'str'>, [<class 'str'>], Schema({}))}),
Optional('trash')]}) did not validate {'name': 'Scripts'}
Missing keys: 'actions', 'locations'

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
zany130commented, Jun 18, 2022

well this seems to work so i guess it wasnโ€™t a bug and it was a formatting issue

private_folders: &Pfolders
    - "pCloudDrive"
    - ".*"
    - "Applications"
    - "The Legend of Heroes Trails of Cold Steel III"

private_files: &Pfiles 
    - ".steampath"
    
rules:
#--------------------------------------------------------------------
    - name: move screenshots into "Screenshots" folder
      locations:
          - path : ~/Pictures/
            max_depth : 0
      filters:
          - name:
                contains: "Screen"
                case_sensitive: false
      actions:
          - move: 
                dest: ~/Pictures/Screenshots/
                on_conflict: rename_new
                rename_template: "{name}-{counter}{extension}"
#--------------------------------------------------------------------

    - name: move Recordings into "Recordings" folder
      locations:
          - ~/Videos/
          - /mnt/GAMES/Videos/
      filters:
          - name:
                contains:
                  - "Record"
                  - "Replay"
                case_sensitive: false
      actions:
          - move:
                dest: /mnt/GAMES/Videos/Recordings/
                on_conflict: rename_new
                rename_template: "{name}-{counter}{extension}"
#--------------------------------------------------------------------

    - name: move Documents into documents folder
      locations:
          - path: ~/
            max_Depth: 1
            exclude_dirs: [*Pfolders]
            exclude_files: [*Pfiles]
      filters:
          - extension:
            - doc
            - docx
            - msg
            - odt
            - pages
            - wpd
            - wps
            - gddoc
            - ppt
            - pptx
            - xlr
            - xls
            - xlsx
            - pdf
            - mobi
      actions:
          - move: 
                dest: ~/Documents/
                on_conflict: rename_new
                rename_template: "{name}-{counter}{extension}"
#--------------------------------------------------------------------
 
    - name: move Log files into Logs folder
      locations:
          - path: ~/
            max_Depth: 1
            exclude_dirs: [*Pfolders]
            exclude_files: [*Pfiles]
      filters:
          - extension:
            - log
      actions:
          - move:
                dest: ~/Logs/
                on_conflict: rename_new
                rename_template: "{name}-{counter}{extension}"
#--------------------------------------------------------------------

    - name: Move applications into Applications folder
      locations:
        - path: ~/
          max_Depth: 2
          exclude_dirs: [*Pfolders]
          exclude_files: [*Pfiles]
      filters:
          - extension:
            - apk
            - app
            - exe
            - msi
            - jar
            - appimage
            - rpm
            - deb
            - pkg
            - .pkg.tar.xz
            - .pkg.tar.zst
      actions:
          - move:
                dest: ~/Applications/
                on_conflict: rename_new
                rename_template: "{name}-{counter}{extension}"

#--------------------------------------------------------------------

    - name: Move audio files into music folder
      locations:
          - path: ~/
            max_Depth: 1
            exclude_dirs: [*Pfolders]
            exclude_files: [*Pfiles]
      filters:
          - extension:
            - aif
            - iff
            - m3u
            - m4a
            - mid
            - mp3
            - mpa
            - wav
            - wma
      actions:
          - move:
                dest: ~/Music/
                on_conflict: rename_new
                rename_template: "{name}-{counter}{extension}"
#--------------------------------------------------------------------

    - name: Move video files into Videos
      locations:
          - path: ~/
            max_Depth: 1
            exclude_dirs: [*Pfolders]
            exclude_files: [*Pfiles]
      filters:
          - extension:
            - 3g2
            - 3gp
            - asf
            - avi
            - flv
            - m4v
            - mov
            - mp4
            - mpg
            - rm
            - srt
            - swf
            - vob
            - wmv
      actions:
          - move:
                dest: /mnt/GAMES/Videos/
                on_conflict: rename_new
                rename_template: "{name}-{counter}{extension}"
#--------------------------------------------------------------------

      name: Move image files into Pictures
      locations:
          - path: ~/
            max_Depth: 1
            exclude_dirs: [*Pfolders]
            exclude_files: [*Pfiles]
      filters:
          - extension:
            - bmp
            - dds
            - gif
            - heic
            - jpg
            - png
            - psd
            - pspimage
            - tga
            - thm
            - tif
            - tiff
            - yuv
            - ai
            - eps
            - svg
      actions:
          - move: 
                dest: ~/Pictures/
                on_conflict: rename_new
                rename_template: "{name}-{counter}{extension}"
#--------------------------------------------------------------------

    - name: Move Archives into compressed folder
      locations:
          - ~/Downloads/
      filters:
          - extension:
            - tar
            - 7z
            - cbr
            - gz
            - rar
            - sitx
            - gz
            - zst
            - xz
            - zip
            - zipx
      actions:
          - move:
                dest: ~/Downloads/Compressed/
                on_conflict: rename_new
                rename_template: "{name}-{counter}{extension}"

#--------------------------------------------------------------------

    - name: Move Scripts into Scripts folder
      locations:
          - path: ~/
            max_Depth: 1
            exclude_dirs: [*Pfolders]
            exclude_files: [*Pfiles]
      filters:
          - extension:
            - sh
            - bat
            - vbs
      actions:
          - move: 
                dest: ~/Scripts/
                on_conflict: rename_new
                rename_template: "{name}-{counter}{extension}"
#--------------------------------------------------------------------

0reactions
xdhmoorecommented, Jun 18, 2022

I think the next error you posted is also caused by indentation. The locations key needs to line up with the name above it. They are both keys of the same map object. I can reproduce it and when I make locations, filters, and actions line up with name above them, the error goes away.

But in your next comment, your full config they look lined up correctly with the names as as far as I can tell. But I noticed that not all of your rules line up, or your locations & filters within a rule. Some of them are off by a space. I guess the theme here is that in YAML the indentation matters.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Change User Name" Not Appearing as Option in Windows ...
If you only have one user on a Windows 10 PC for some unknown reason the option to change the user name does...
Read more >
Fix Disappeared Files and Folders Names in Windows 10
Fix Disappeared Files and Folders Names in Windows 10โ–ปโ–ปโ–ปSUBSCRIBE for more : https://www.youtube.com/user/Britec09?sub_confirmation=1Iย ...
Read more >
the command find not working with -name option in sh file
When I remove the -o -name '*.json' part, the command works well, and returns the number of files containing the 'sv' in their...
Read more >
How to Fix the Excel Name Error? 3 Simple Tips
Tip 3 โ€“ Find All the #NAME Errors in Excel ยท Select the data where you want to scan for errors. ยท In...
Read more >
[Solved] File Explorer Search Not Working in Windows 10
Step 4: In the Folder Options window, switch to Search tab and check Always search file names and contents option.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found