From e359b0ee79cb4edf6c59af0b4c411ec2d5f808c5 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 2 Oct 2014 11:46:11 +0100 Subject: Add automatic garbage collection service to Trove We are now using Trove as an artifact server for the Mason continuous delivery system, which can fill up the disk pretty quickly. This adds a rudimetary system for cleaning up old artifacts from an artifact cache server. Note that it does not have any smarts about what to remove other than checking the 'mtime', If you have important release artifacts in the artifact cache, don't run `trove-gc` or enable the trove-garbage-collect service. It wraps the `morph gc` command, currently, so Morph is required on the system. Morph is included in Trove systems via the 'tools' stratum right now. It is hardcoded to remove artifacts until there is at least 15GB of free disk space, and to run once an hour. No cleanup of Git or Lorry data is done. --- units/trove-garbage-collect.service | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 units/trove-garbage-collect.service (limited to 'units/trove-garbage-collect.service') diff --git a/units/trove-garbage-collect.service b/units/trove-garbage-collect.service new file mode 100644 index 0000000..9f58873 --- /dev/null +++ b/units/trove-garbage-collect.service @@ -0,0 +1,9 @@ +[Unit] +Description=Remove old artifacts from the artifact cache until 15GB of space is free. + +[Service] +Type=idle +ExecStart=/usr/bin/trove-gc --cachedir-min-space=15G --log=syslog --verbose + +[Install] +WantedBy=trove-garbage-collect.service -- cgit v1.2.1