Now it works - except it doesn't. Maybe I shouldn't hide the error in the compactor.
This commit is contained in:
parent
98c58363d9
commit
c28dc06816
3 changed files with 4 additions and 6 deletions
|
@ -16,4 +16,3 @@ BACKUP_S3_ACCESS_ID=0000000000000000000000000
|
|||
BACKUP_S3_SECRET_ID=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
BACKUP_S3_ENDPOINT=https://s3.us-east-005.backblazeb2.com
|
||||
BACKUP_S3_REGION=us-east-005
|
||||
BACKUP_SOURCE_PATH=/backups/guestbooky_$(date +\%Y-\%m-\%d)
|
|
@ -66,7 +66,7 @@ services:
|
|||
--username ${GUESTBOOKY_USER}
|
||||
--password ${GUESTBOOKY_USER}
|
||||
--authenticationDatabase ${GUESTBOOKY_DB_NAME}
|
||||
--out ${BACKUP_SOURCE_PATH} && touch /backups/backup_done"
|
||||
--out /backups/guestbooky_$(date +\%Y-\%m-\%d) && touch /backups/backup_done"
|
||||
volumes:
|
||||
- ./backups:/backups
|
||||
depends_on:
|
||||
|
@ -88,10 +88,9 @@ services:
|
|||
BACKUP_S3_SECRET_ID: ${BACKUP_S3_SECRET_ID}
|
||||
BACKUP_S3_ENDPOINT: ${BACKUP_S3_ENDPOINT}
|
||||
BACKUP_S3_REGION: ${BACKUP_S3_REGION}
|
||||
BACKUP_SOURCE_PATH: ${BACKUP_SOURCE_PATH}
|
||||
BACKUP_DESTINATION_PATH: ${BACKUP_SOURCE_PATH}.gzip
|
||||
volumes:
|
||||
- ./backups:/backups
|
||||
command: sh -c "export BACKUP_SOURCE_PATH=/backups/guestbooky_$(date +\%Y-\%m-\%d) && export BACKUP_DESTINATION_PATH=/backups/guestbooky_$(date +\%Y-\%m-\%d).gzip && /root/guestbooky-backup"
|
||||
|
||||
volumes:
|
||||
mongodata:
|
||||
|
|
|
@ -34,7 +34,7 @@ func Compact(source, destination string) error {
|
|||
defer zipWriter.Close()
|
||||
|
||||
if _, err := io.Copy(zipWriter, originFileHandle); err != nil {
|
||||
return errors.New("failed to copy file")
|
||||
return errors.New("failed to copy zip to destination file: " + err.Error()) //nolint:wraperr
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue