定期为 Gitlab 做备份
Take backup for Gitlab periodically
通过运行 sudo gitlab-rake gitlab:backup:create
我们可以手动为Gitlab创建备份。但是有什么办法可以定期备份Gitlab,比如每天或每月。
PS: 我希望备份文件在本地文件夹而不是任何云存储中
一个好的开始是“Configuring cron to make daily backups ”
部分
To schedule a cron job that backs up your repositories and GitLab metadata, use the root user:
sudo su -
crontab -e
There, add the following line to schedule the backup for everyday at 2 AM:
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
通过运行 sudo gitlab-rake gitlab:backup:create
我们可以手动为Gitlab创建备份。但是有什么办法可以定期备份Gitlab,比如每天或每月。
PS: 我希望备份文件在本地文件夹而不是任何云存储中
一个好的开始是“Configuring cron to make daily backups ”
部分To schedule a cron job that backs up your repositories and GitLab metadata, use the root user:
sudo su - crontab -e
There, add the following line to schedule the backup for everyday at 2 AM:
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1