Set up InfluxDB task to copy local database to cloud every minute

Viewed 77

I'm trying to set up a task in my local InfluxDb that will upload to the cloud InfluxDb every minute. The local database is receiving real time data from sensors.

This is what I have so far but the task will start and never close

import "influxdata/influxdb/secrets"
import "influxdata/influxdb/tasks"

from(
        bucketID: "e12csad2dsas",
        host: "http://localhost:8086",
        orgID: "asd3asdsa33",
        token: "dasd3dsaf345454asdsad4Rf2pRslbjKy-QT_NOofsWzz20bGGb************",
        )

        |> range(start: 2021-10-05T00:00:00Z)
        |> aggregateWindow(every: 1s, fn: mean)

        |> to(
        host: "https://cloud2.influxdata.com",
        orgID: "d32d32dd23d233d",
        bucketID: "b13a1as3530742a3",
        token: "gQaPs6LVKyOKIX_4assfs3daRf2pRslbjKsaQ*******************",
    )
0 Answers
Related