You can change BACKUPDAYS=7 to a number you want. It’s set for 7 days more or less. Its possible to then set up a cronjob to runs that script once a day or something.
#!/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 {} \;
For single execution:
find /var/opt/gitlab/backups -type f -ctime +7 -exec rm -f {} \;
This is also possible in addition to deleteing old backups. See the official Documentation.
If for some reason you don’t want to use pip, you can also just:
mkdir -p ~/bin
curl -o ~/bin/git-filter-repo https://raw.githubusercontent.com/newren/git-filter-repo/main/git-filter-repo
chmod +x ~/bin/git-filter-repo