You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a chance to set a default rule in case no other rule is executed?
I've a set of rules described in the config and then a bunch of files, where these rules have to be used for. I run this as a cron task periodically on a dedicated inbox folder and with the rules the files are moved to several destinations.
My problem is that all files, where no rule matched, stay in the inbox folder and then in the next cron task run they were processed again and again.
I would be pleased, if there is an option to set a default/fallback rule, in case all other rules cannot be matched. Then, my unprocessed file can be moved to a folder "no_rules_available" and I can check, whether I have to create new rules for.
Currently I added a stupid rule at the end of the config file, just for all files, which is then always processed for this movement. But then in all my other rules I get in the logs the message:
" - [Move] ERROR! [Errno 2] No such file or directory: '/source/xyz.pdf' "
I think the reason is that than more than one rule is matching and both are tried to execute. But they cannot moved twice, because the first, real rule has moved the file to the correct destination. This workaround is just my last option, but I don't know, whether the rules are processed in the right order and my "fallback" rule is processed first. Therefore I wanted to have this option explicitely, if possible.
Thanks and kind regards,
Ralf
The text was updated successfully, but these errors were encountered:
Thank you for reporting this. organize v2 is around the corner where the rules are processed just as written, so this will be possible. I'll keep you updated 👍
In this version the rules are worked from top to bottom.
rules:
- name: "Processing all files starting with B"locations: ~/Desktopfilters:
- name:
startswith: "B"actions:
- echo: "Processing"
- name: "Files that do not match our previous rules"locations: ~/Desktopactions:
- echo: "The default action"
Is there a chance to set a default rule in case no other rule is executed?
I've a set of rules described in the config and then a bunch of files, where these rules have to be used for. I run this as a cron task periodically on a dedicated inbox folder and with the rules the files are moved to several destinations.
My problem is that all files, where no rule matched, stay in the inbox folder and then in the next cron task run they were processed again and again.
I would be pleased, if there is an option to set a default/fallback rule, in case all other rules cannot be matched. Then, my unprocessed file can be moved to a folder "no_rules_available" and I can check, whether I have to create new rules for.
Currently I added a stupid rule at the end of the config file, just for all files, which is then always processed for this movement. But then in all my other rules I get in the logs the message:
" - [Move] ERROR! [Errno 2] No such file or directory: '/source/xyz.pdf' "
I think the reason is that than more than one rule is matching and both are tried to execute. But they cannot moved twice, because the first, real rule has moved the file to the correct destination. This workaround is just my last option, but I don't know, whether the rules are processed in the right order and my "fallback" rule is processed first. Therefore I wanted to have this option explicitely, if possible.
Thanks and kind regards,
Ralf
The text was updated successfully, but these errors were encountered: