Remove files at /var/opt/gitlab/backups

hi
how I can set it auto remove backups file in /var/opt/gitlab/backups ?
I already setting oin gitlab.rb for gitlab_rails[‘backup_keep_time’] = 604800

but that is just remove for configure backups only.

how it can be set scheduler remove the /var/opt/gitlab/backups

thanks.

Hi,

I tend to do something like this in a script:

#!/bin/bash
#
# Delete old gitlab backups

# Variables
GITLABBACKUPS=/var/opt/gitlab/backups
BACKUPDAYS=7

# Cleanup old backups
find $GiTLABBACKUPS -type f -ctime +$BACKUPDAYS -exec rm -f {} \;

change BACKUPDAYS=7 to a number you want. It’s set for 7 days more or less. Then set up a cronjob to run that once a day or something.

1 Like

ok, thanks