Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watch command to run a script on filesystem changes #38

Open
5 tasks
sandreas opened this issue Mar 8, 2023 · 0 comments
Open
5 tasks

watch command to run a script on filesystem changes #38

sandreas opened this issue Mar 8, 2023 · 0 comments

Comments

@sandreas
Copy link
Owner

sandreas commented Mar 8, 2023

I would like to have a watch command to watch a directory for filesystem changes and run shell commands, so that it is possible to watch a directory with audio books and start a conversion tool, as soon as new files are put in.

Important Note:
Maybe this exceeds the scope of tone as an audio tagger and has to be extracted in an extra tool (like fswatch, fswatcher, fsmon or baywatch - last name is to prevent name conflicts with existing more popular tools like https://github.com/emcrisostomo/fswatch)

Tasks:

  • implement watch command with a --directory parameter to specify the directory
  • add --debounce-milliseconds=<timespan> parameter to prevent running immediately on a change (e.g. when still copying files) to prevent too early execution
  • add --event-type parameter (multiple usage) to watch for specific events (changed, renamed, created, deleted)

Optional tasks / ideas:

  • implement --ignore-errors parameter for e.g. directory is not existing (retry to register the filesystem watcher
  • implement --retry-on-error-milliseconds for --ignore-errors

Example:

tone watch --directory="/tmp/dir/" --debounce-milliseconds="300000" ls /tmp/dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant