Collection of CSV every week/month, on a specific day

Hello,
I have two CSV files which are updated every week and every month with manual readings I do from some home devices (electricity and gas panels).
The week’s CSV file is being updated approx on Monday, the month’s CSV file approx by the 7th of month.
Is it possible to run the data collection by Telegraf on specific days (e.g. every Monday or every 7th of the month)?
I would avoid to set the interval to 1d because of having flat results unusefully for many days.

Thanks you.
Regards.

Riccardo

If you know when the data will be around you have a couple options:

  1. Use a cron job to execute telegraf with the --once option. This will just run one input or output cycle
  2. Write your own script in a programming language of your choice to parse the data and send the data to InfluxDB using the client libraries instead.

Telegraf is a better agent versus something that is run once and a while, but it is possible.

1 Like

Hello, thanks for your very fast reply.
Solution at point 1. looks like interesting and probably the easier for me to build. I run Telegraf in a docker container so I am not sure I can setup a cron job and getting that persistent… Anyway, should I disable the Interval parameter in the Telegraf .conf file or does this lead to an error?
Solution at point 2. is more difficult because of lack of experience and knowledge in code programming.

Thanks for now.

You don’t need an interval as it will be ignored anyway when using --once. Without the value specified, Telegraf will default to 10 seconds.