helicopterizer icon indicating copy to clipboard operation
helicopterizer copied to clipboard

Using `BACKUP_NAME` with empty `BACKUP_PREFIX` doesn't work at all

Open firehist opened this issue 9 years ago • 1 comments


testIt () {
  local backupPrefix=$1
  local backupName=$2
  local name=''

  if [ -n "$backupName" ]; then
    name="1"
  else
    name="2"
  fi
  echo "$name"
}

BACKUP_PREFIX=
BACKUP_NAME=jenkins

echo $(test $BACKUP_PREFIX $BACKUP_NAME)
# Ouput 2

BACKUP_PREFIX="beurk"
echo $(test $BACKUP_PREFIX $BACKUP_NAME)
# Output 1

firehist avatar Sep 12 '16 15:09 firehist

I've made that PR. The idea is if that you define $BACKUP_NAME it overrides everything else. So it will end $BACKUP_NAME.tar.gz (pretty useful if you use S3 versions) with life cycles. So it doesn't make to define $BACKUP_PREFIX and $BACKUP_NAME at the same time.

Maybe it's confusing and should warn that PREFIX shouldn't be defined …

Currently I'm using this in prod with no problem

docker run --rm \
--env-file .env-backup \
-v atlassian_db:/data/db:ro \
-v atlassian_jira:/data/jira:ro \
-v atlassian_confluence:/data/confluence:ro \
--name backup helicopterizer backup --tarball

Starting Helicopterizer ...
Cloud Provider is Amazon Simple Storage Service (S3)
STORAGE_PROVIDER=AWS
BACKUP_NAME=docker-atlassian
BACKUP_VERSION=
DATA_PATH=/data/
CRON_SCHEDULE=
GZIP_COMPRESSION=true
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_S3_BUCKET_NAME=
AWS_DEFAULT_REGION=us-east-1
AWS_S3_PATH=/
AWS_S3_OPTIONS=
Starting Tarball Backup to AWS ...
Starting compress: /data/ to /tmp/docker-atlassian.tar.gz

luishdez avatar Jan 02 '17 05:01 luishdez