How to configure cron task for "Delete all repositories' archives (ZIP, TAR.GZ, etc..)"?

We have some large repos that cause a ton of zip and tar archives to be built and stored over time. The Mastodon one even generates a cool 89GB of those at the moment.

Running the task “Delete all repositories’ archives (ZIP, TAR.GZ, etc…)” from the admin panel fixes the issue temporarily. However, it’s not documented how to schedule that task via the config:

Config cheat sheet: Extended cron tasks (not enabled by default)

Maybe it’s just missing from the documentation?

A related question would be if it’s possible to turn off archive generation by default, since e.g. the Mastodon repo comes with its own checked-in archives, which are then re-archived for every tag, causing this extreme disk space usage. So it would be useful if people activated repo archives only for the repos that they actually want zip/tar archives to be generated for (which are none on our instance at the moment).

Nobody has any pointers for where to look?

You propably want the “cron.archive_cleanup” section: app.example.ini L1773-L1788

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Clean up old repository archives
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[cron.archive_cleanup]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Whether to enable the job
;ENABLED = true
;; Whether to always run at least once at start up time (if ENABLED)
;RUN_AT_START = true
;; Whether to emit notice on successful execution too
;NOTICE_ON_SUCCESS = false
;; Time interval for job to run
;SCHEDULE = @midnight
;; Archives created more than OLDER_THAN ago are subject to deletion
;OLDER_THAN = 24h

And yes, not all options are described in the cheat sheet, but the app.example.ini should always have all config options listed.

Edit: there is also the “cron.delete_repo_archives” section that might help to get rid of your problem: app.example.ini L1954-L1963

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Delete all repository archives
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[cron.delete_repo_archives]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;ENABLED = false
;RUN_AT_START = false
;NOTICE_ON_SUCCESS = false
;SCHEDULE = @annually;
1 Like