Skip to content

Instantly share code, notes, and snippets.

@trdlo
Forked from yyfrankyy/BackupGitlab.sh
Created August 25, 2013 20:46
Show Gist options
  • Save trdlo/6336196 to your computer and use it in GitHub Desktop.
Save trdlo/6336196 to your computer and use it in GitHub Desktop.
#!/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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment