# Read files and once daily read all the files again

**URL:** <https://discuss.elastic.co/t/read-files-and-once-daily-read-all-the-files-again/201620>\
**Category:** Logstash\
**Created:** [September 30, 2019, 11:23am UTC](https://discuss.elastic.co/t/read-files-and-once-daily-read-all-the-files-again/201620 "2019-09-30T11:23:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ansamHox](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@ansamHox](https://discuss.elastic.co/u/ansamHox)\
**Post date:** [September 30, 2019, 11:23am UTC](https://discuss.elastic.co/t/read-files-and-once-daily-read-all-the-files-again/201620/1 "2019-09-30T11:23:24Z")

</div>

Hi, I have situation where our database team export around 100 csv files during a day which I need to import to Elasticsearch. It is being done by NFS, and I have logstash constantly running so when new file is created he starts to read it. Because very often we have problems (beacuse of NFS I suppose [reading file that is being written to]) I want to schedule every morning job to run all files again ind import them back (I'm overriding doc\_id so it can't be duplicates).

```
input{
    file{
        id => "live_import_transaction_files"
        path => "/logstash/transactions_*"
        start_position => "beginning"
        sincedb_path => "/etc/logstash/sincedb_transactions"
        file_completed_action => "log"
        file_completed_log_path => "/etc/logstash/file_completed"

```

Now, every day at 7:30am I want to reimport whole folder if some error occured, but my input and output are the same.

```
input{
    file{
        id => "daily_import_transaction_files"
        path => "/logstash/transactions_*"
        start_position => "beginning"
        sincedb_path => "/dev/null"
        ignore_older => 0

```

pipelines.yml would look like:

> ```
> - pipeline.id: live_import_transaction_files
> path.config: "/etc/logstash/import_csv_es.conf"
> - pipeline.id: live_import_transaction_files
> path.config: "/etc/logstash/import_daily.conf"
> 
> ```

Is there any way to trigger this other pipeline in crontab or some scheduler every day at the same time, because I can't run 2 pipelines with same input/output. Or is there any better approach, because I need to make sure that everything is on ES every morning around 8am.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [September 30, 2019, 2:09pm UTC](https://discuss.elastic.co/t/read-files-and-once-daily-read-all-the-files-again/201620/2 "2019-09-30T14:09:27Z")

</div>

> [@ansamHox](#):
>
> ignore\_older =\> 0

I cannot speak to the scheduling problem, but that says to ignore any files which are more than zero seconds old, which means it will ignore all files.

---

<div class="post-metadata">

**Author:** ![ansamHox](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@ansamHox](https://discuss.elastic.co/u/ansamHox)\
**Post date:** [September 30, 2019, 2:54pm UTC](https://discuss.elastic.co/t/read-files-and-once-daily-read-all-the-files-again/201620/3 "2019-09-30T14:54:37Z")

</div>

no, this means it will include everything.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 28, 2019, 2:54pm UTC](https://discuss.elastic.co/t/read-files-and-once-daily-read-all-the-files-again/201620/4 "2019-10-28T14:54:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
