Can this be achieved via UI? Basically a button that says “Discard previous version”? I have to connect via SSH every time in order to delete the backup and temporary file. Would be great if there was a button in the UI similar to “Restart after update”.
I think you can achieve this in several ways. Question is if this should be automatically done or not.
When run as a service on linux add a ExecStartPre command that removes the bak file on startup (or with a ExecStartPost to clean on shutdown)
When the controller has executors create a small freestyle job that deletes the file
when the controller has no executors create a pipeline script that deletes the file (the script must not use the sandbox and requires admin approval). That script can also be run as an init.groovy script on startup
Those are good points, thank you. I am restarting Jenkins from the UI. As far as I can see SystemD is not involved and it looks like the service kept running all the time. I restarted it from UI and systemctl still shows “3 days ago” in the “Active” line. Thus ExecStartPre and Post are not called.
Jobs and scripts would also be a solution, sure. I will take a look. I would just find it convenient if there was a button besides “Downgrade to …” that says “Remove backup” or “Remove old version”. Sorry, I know, I sound like a consumer here
Good point. It is a small installation and after a small testing period (basically running all builds once) I would like to get rid of the message. And as I am doing everything from the UI now (like updating plugins and running the dist upgrade) I would also like to do that from there. Sure, I have SSH access and can do it as a scheduled task or from the command line. It would just be nice to be able to do it in the UI as well. But it is in no way critical. Thanks for taking time to respond and discuss this!