简体   繁体   中英

Python script to automate influxdb backups

I'm looking for a way to automate the backup of my InfluxDB databases via Python. Did anyone has done it yet? Or it doesn't make any sense to do it via Python and I should just stick to a bash script (like this one: https://gist.github.com/opHASnoNAME/7b367abfbba8b34f3591842db8814a8f )?

I have finished such a script recently, running it for influxdb and mongodb hourly by jenkins.

There are two folders to store the backups.

One named "hourly_backups" stores the latest 24 hourly backups.

Another one named "daily_backups" holds the earliest hourly backup of last 7 days.

After backup is successfully finished, it will clean the old files to control the total size.

It sounds easy but must be careful.

I agreed that bash better for use. But you can also do it in python as a training.

People who has questions about the backups scripts of these two dbs can discuss it with me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM