Skip to content

Commit

Permalink
Add support for run only once
Browse files Browse the repository at this point in the history
Sometimes you would like to control externally (using a crontab) for example, how often you want to scan an index a hard drive.
Also, you might want to do it only once so you don't need to "watch" for changes.

In such a case, waiting for a message in logs is far from being ideal.

Let's add a new option `loop` which defines the number of runs we want before exiting:

* `X` where X is a negative value means infinite, like `-1` (default)
* `0` means that we don't run FSCrawler. Well... Not sure what could be the usage. May be checking that the configuration file is correct?
* `X` where X is a positive value is the number of runs before it stops.

If you want to scan your hard drive only once, run with `--loop 1`.

Based on dadoonet#223 (comment)

Closes dadoonet#227.
  • Loading branch information
dadoonet committed Sep 14, 2016
1 parent 3ed2469 commit 86ca509
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Read [Autogenerated mapping](#autogenerated-mapping) for more information.
* `--config_dir` defines directory where jobs are stored instead of default `~/.fscrawler`.
* `--username` defines the username to use when using an secured version of elasticsearch cluster. Read
[Using Credentials](#using-credentials). (From 2.2)
* `--loop x` defines the number of runs we want before exiting:
* `--loop x` defines the number of runs we want before exiting (From 2.2):

* `X` where X is a negative value means infinite, like `-1` (default)
* `0` means that we don't run FSCrawler. Well... Not sure what could be the usage. May be checking that the configuration file is correct?
Expand Down

0 comments on commit 86ca509

Please sign in to comment.