Showing
3 changed files
with
13 additions
and
4 deletions
1 | +## 0.4.1 - 2017-01-04 | |
2 | +### Fixed | |
3 | +- Bug where backup script uploads an additional, unneeded copy if bak_maxcopies is set to 1. | |
4 | + | |
1 | 5 | ## 0.4.0 - 2016-12-13 |
2 | 6 | ### Added |
3 | 7 | - AWS bucket and region can now be specified per element of the attribute `node['backup-file2s3']['backups']`. If not specified, bucket and region will default to the global node attributes `node['backup-file2s3']['bucket']` and `node['backup-file2s3']['region']`, respectively. | ... | ... |
... | ... | @@ -4,7 +4,7 @@ maintainer_email 'sysadmin@chromedia.com' |
4 | 4 | license 'Apache License' |
5 | 5 | description 'Creates a script to backup directories into an S3 bucket.' |
6 | 6 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) |
7 | -version '0.4.0' | |
7 | +version '0.4.1' | |
8 | 8 | |
9 | 9 | depends 'awscli', '~> 1.0.1' |
10 | 10 | depends 'cron', '~> 1.7.4' | ... | ... |
... | ... | @@ -81,9 +81,14 @@ increment_backup_names() { |
81 | 81 | done |
82 | 82 | |
83 | 83 | if echo "$baks" | grep "^${bak_keyname}\$" ; then |
84 | - "$aws_bin" --region "$region" \ | |
85 | - s3 mv --recursive "s3://${bucket}/${bak_keyname}" \ | |
86 | - "s3://${bucket}/${bak_keyname}.1" | |
84 | + if [[ $max_backups -gt 1 ]] ; then | |
85 | + "$aws_bin" --region "$region" \ | |
86 | + s3 mv --recursive "s3://${bucket}/${bak_keyname}" \ | |
87 | + "s3://${bucket}/${bak_keyname}.1" | |
88 | + else | |
89 | + "$aws_bin" --region "$region" \ | |
90 | + s3 rm --recursive "s3://${bucket}/${bak_keyname}" | |
91 | + fi | |
87 | 92 | fi |
88 | 93 | } |
89 | 94 | ... | ... |