HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Backup Jenkins log files to external cloud storage

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
logjenkinsstoragecloudfilesexternalbackup

Problem

I'm looking to automatically back up Jenkins log files for all jobs running on our master and slaves once a week, moving them to aws' s3 and deleting them from their respective directories when done.

My question is, is there an existing plugin that has the capabilities I need, or will I need to do this manually?

I've found the Periodic Backup Plugin but it only seems to back up locally, and is focused on config files, not log files (although I could use negative pathing to ignore everything but log files...which would be a massive pain). Likewise, ThinBackup is also config-only. I'm hoping someone might have seen something googling isn't turning up.

Solution

Historically, I approached this a bit differently. I added a post-build step to each job, and had it copy the output to S3 at execution time via the S3 plugin. This blog post covers the moving parts n a pretty granular detail.

You may want to reference


wget -O console-output.log ${BUILD_URL}consoleText

as the output for the job in question in your build task.

Context

StackExchange DevOps Q#1474, answer score: 4

Revisions (0)

No revisions yet.