Document how to create backups from a cron job
Explain how to set up a cron job that backs up GitLab every night at 2am.
Designs
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Contributor
@jacobvosmaer This setup worked for me, but it requires to use crontab as root: What do you think?
# as root crontab -e # Add this line 0 2 * * * gitlab-rake gitlab:backup:create
- Author Contributor
What version of the package did you install? We fixed a bug in the backup script reported in #79 (closed) in https://gitlab.com/gitlab-org/omnibus-gitlab/commits/6.6.5.omnibus .
Have you tried putting a script in
/etc/cron.daily
? That might be a cleaner solution; less places for an administrator to look for cronjobs. - Contributor
6.6.5 (downloaded today)
will give that a try :)
- Author Contributor
https://help.ubuntu.com/community/CronHowto
On the other hand, adding the single line to root's own crontab is probably the easiest thing to do, and it gives you more flexibility to decide when the backup is created. The time cron.daily is run is a system setting, and it may not be the best time for backups.
Let's stick with your first suggestion. I will try it on CentOS 6.
- Author Contributor
Confirmed for CentOS 6. Could you create a MR for the README @JobV ?
- Contributor
Of course :)
- 🚄 Job van der Voort 🚀 mentioned in merge request !64 (merged)
mentioned in merge request !64 (merged)
- 🚄 Job van der Voort 🚀 Status changed to closed
Status changed to closed
what if I would like a back up at 4p.m.? what am I supposed to do?
16 0 * * * gitlab-rake gitlab:backup:create
- Contributor
0 16 * * * gitlab-rake gitlab:backup:create.
@Tom_Salles see here: http://www.adminschoice.com/crontab-quick-reference/
Thanks @JobV !!
How can I set an automatic back up overwrite, like
june 1st, june 2nd, 3d... june 30th and the july 1st's back up overwrite the june 1st's files?
I can repeat this line (down) to set automatic back ups, hourly, but how can I set this "automatic overwrite" ?
0 1 * * * gitlab-rake gitlab:backup:create.
- Contributor
@Tom_Salles I think it's best if you have a look here: https://www.gitlab.com/getting-help/
It doesn't seem like a good idea to discuss specifics like this in an unrelated, closed issue.
Ok, @JobV thanks again!