Created
June 30, 2014 20:37
-
-
Save choyer/654aa70babf90b9a4b56 to your computer and use it in GitHub Desktop.
Backup 4.x Daily Gitlab Backup Model
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
Model.new(:daily_gitlab_backup, 'Daily Backup for Gitlab') do | |
archive :gitlab_backup do |archive| | |
# archive.use_sudo | |
file_name = Dir.glob('/home/git/gitlab/tmp/backups/*').max_by{|f| File.ctime(f)} | |
archive.add file_name | |
end | |
store_with S3 do |s3| | |
s3.access_key_id = ENV['S3_ACCESS_KEY_ID'] | |
s3.secret_access_key = ENV['S3_SECRET_ACCESS_KEY'] | |
s3.keep = 30 | |
s3.region = "us-east-1" # http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region | |
s3.bucket = "your-bucket-name" | |
s3.path = "/daily" | |
end | |
notify_by Pushover do |pushover| | |
pushover.on_success = true | |
pushover.on_warning = true | |
pushover.on_failure = true | |
pushover.user = ENV['PUSHOVER_USER_KEY'] | |
pushover.token = ENV['PUSHOVER_API_KEY'] | |
pushover.title = 'Gitlab Backup' # optional | |
#pushover.device = 'The device identifier' # optional | |
pushover.priority = '0' # optional | |
end | |
compress_with Gzip | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment