dokgu
dokgu

Reputation: 6050

GitLab backup auto-cleanup

So I have GitLab installed on our server and I also followed their guide on how to setup the backups.

Goal

  1. [Source] Create a cron task to backup the data every Tuesday - Saturday at 2:00 AM
  2. [Source] Upload the created backup file to a Windows mounted drive
  3. [Source] Remove backup files older than 2 weeks (14 days) on both the local server and the Windows mounted drive

So far only 2½ of my goals are achieved.

For #3, setting gitlab_rails['backup_keep_time'] = 1209600 only cleans up the files on the local server but not the uploaded files on the mounted Windows drive.

What do I need to do so that GitLab cleans both backup locations?


Additional Info

I have used the GitLab CE Omnibus installation.
Currently our version is GitLab CE 9.1.2 df1403f

Upvotes: 0

Views: 1319

Answers (1)

dokgu
dokgu

Reputation: 6050

I couldn't find an answer where GitLab will take care of this for me so I just created another cron task:

0 3 * * * find /path/to/mounted/drive/ -mindepth 1 -maxdepth 1 -name "*_gitlab_backup.tar" -mtime +13 -delete

Upvotes: 1

Related Questions