Last active
December 28, 2017 20:57
-
-
Save yyfrankyy/5981215 to your computer and use it in GitHub Desktop.
Backup Gitlab Day by day to Dropbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# You might want to put this script in crontab, backup day by day. | |
# | |
# $ sudo -u git -H crontab -l | |
# $ 0 0 1 * * /path/to/your/BackupGitlab.sh | |
cd /home/git/gitlab | |
/usr/local/bin/bundle exec rake gitlab:backup:create RAILS_ENV=production | |
# Create a dropbox app https://www.dropbox.com/developers | |
# Get an Uploader https://github.com/andreafabrizi/Dropbox-Uploader | |
# Run this script first, it saved config to ~/.dropbox_uploader by default. | |
# Upload last backup to Dropbox | |
/path/to/your/dropbox_uploader.sh -f /path/to/your/.dropbox_uploader upload `find /home/git/gitlab/tmp/backups/ -type f -exec ls -1rt "{}" + | tail -n 1` |
这个是备份整个数据库的,project,issue,wiki,user这些。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
还可以这样
.git/config