Last active
August 29, 2015 14:03
-
-
Save choyer/a83dc63ba13897eddb79 to your computer and use it in GitHub Desktop.
Backup 4.x Monthly Gitlab Backup Model
This file contains 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(:monthly_gitlab_backup, 'Monthly 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.region = "us-east-1" # http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region | |
s3.bucket = "your-bucket-name" | |
s3.path = "/monthly" | |
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