Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
omnibus-heptapod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
heptapod
omnibus-heptapod
Commits
348bf9d0
Commit
348bf9d0
authored
8 years ago
by
John McGehee
Browse files
Options
Downloads
Patches
Plain Diff
How to make daily configuration backups with cron.
Due to cron gotchas, it's kind of tricky.
parent
7c12e2c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/settings/backups.md
+23
-0
23 additions, 0 deletions
doc/settings/backups.md
with
23 additions
and
0 deletions
doc/settings/backups.md
+
23
−
0
View file @
348bf9d0
...
...
@@ -22,6 +22,29 @@
sudo
sh
-c
'umask 0077; tar -cf $(date "+etc-gitlab-%s.tar") -C / etc/gitlab'
```
To create a daily application backup, edit the cron table for user root:
```
shell
sudo
crontab
-e
-u
root
```
The cron table will appear in an editor.
Enter the command to create a compressed tar file containing the contents of
`/etc/gitlab/`
. For example, schedule the backup to run every morning after a
weekday, Tuesday (day 2) through Saturday (day 6):
```
15 04 * * 2-6 umask 0077; tar cfz /secret/gitlab/backups/$(date "+etc-gitlab-\%s.tgz") -C / etc/gitlab
```
[
cron is rather particular
](
http://www.pantz.org/software/cron/croninfo.html
)
about the cron table. Note:
-
The empty line after the command
-
The escaped percent character:
\%
You can extract the .tar file as follows.
```
shell
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment