Created
April 21, 2021 16:45
-
-
Save johanvdw/4ee0a8f67f094cc953598248f46ba9a0 to your computer and use it in GitHub Desktop.
Export drone logs from sqlite to S3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This simple scripts dumps all logs from drone to a format | |
# compatible with drone s3 storage (cfr https://docs.drone.io/server/reference/drone-s3-bucket/ ) | |
# MIT license - https://opensource.org/licenses/MIT | |
import sqlite3 | |
conn = sqlite3.connect("drone_database.sqlite") | |
select_logs(conn) | |
cur = conn.cursor() | |
cur.execute("select * FROM logs") | |
for r in cur: | |
with open('logs/'+str(r[0]), 'wb') as file: | |
file.write(r[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment