databacker / mysql-backup

image to enable automated backups of mysql databases in containers
648 stars 185 forks source link

target.sh scripts don't get executed #208

Closed RogerSik closed 1 year ago

RogerSik commented 2 years ago

docker-compose.yml

version: '3.4'
volumes:
  dbmysql:

services:
  mysql:
    image: mysql:5.7
    environment:
      - MYSQL_DATABASE=wordpress
      - MYSQL_USER=wordpress
      - MYSQL_PASSWORD=wordpress
      - MYSQL_ROOT_PASSWORD=wordpress_root
    volumes:
      - ./volumes/db/:/var/lib/mysql
    command: --datadir=/var/lib/mysql/data --character-set-server=utf8 --collation-server=utf8_bin

  wordpress:
    image: wordpress
    environment:
      - WORDPRESS_DB_HOST=mysql
      - WORDPRESS_DB_USER=wordpress
      - WORDPRESS_DB_PASSWORD=wordpress
      - WORDPRESS_DB_NAME=wordpress
    ports:
      - "80:80"

  mysql-backup:
    image: databack/mysql-backup
    volumes:
      - ./volumes/db_dump:/backup/
      - ./scripts/target:/scripts.d/target.sh/
    environment:
      - DB_SERVER=mysql
      - DB_USER=wordpress
      - DB_PASS=wordpress
      - DB_NAMES=wordpress
      - DB_PORT=3306
      - DB_DUMP_DEBUG=true

./scripts/target/test.sh

#!/bin/bash
# Rename backup file.

echo -n "latest.gz"

Created dump file name: db_backup_2022-11-01T16:40:52Z.tgz

Script can be executed in container itself

$ docker compose exec mysql-backup bash
bash-4.4$ //scripts.d/target.sh/test.sh 
latest.gz
bash-4.4$ 

Not sure what i'm doing wrong?

docker compose logs -f mysql-backup

examples-mysql-backup-1  | + file_env DB_SERVER
examples-mysql-backup-1  | + local var=DB_SERVER
examples-mysql-backup-1  | + local fileVar=DB_SERVER_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' mysql ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' mysql ']'
examples-mysql-backup-1  | + val=mysql
examples-mysql-backup-1  | + export DB_SERVER=mysql
examples-mysql-backup-1  | + DB_SERVER=mysql
examples-mysql-backup-1  | + unset DB_SERVER_FILE
examples-mysql-backup-1  | + file_env DB_PORT
examples-mysql-backup-1  | + local var=DB_PORT
examples-mysql-backup-1  | + local fileVar=DB_PORT_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' 3306 ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' 3306 ']'
examples-mysql-backup-1  | + val=3306
examples-mysql-backup-1  | + export DB_PORT=3306
examples-mysql-backup-1  | + DB_PORT=3306
examples-mysql-backup-1  | + unset DB_PORT_FILE
examples-mysql-backup-1  | + file_env DB_USER
examples-mysql-backup-1  | + local var=DB_USER
examples-mysql-backup-1  | + local fileVar=DB_USER_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' wordpress ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' wordpress ']'
examples-mysql-backup-1  | + val=wordpress
examples-mysql-backup-1  | + export DB_USER=wordpress
examples-mysql-backup-1  | + DB_USER=wordpress
examples-mysql-backup-1  | + unset DB_USER_FILE
examples-mysql-backup-1  | + file_env DB_PASS
examples-mysql-backup-1  | + local var=DB_PASS
examples-mysql-backup-1  | + local fileVar=DB_PASS_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' wordpress ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' wordpress ']'
examples-mysql-backup-1  | + val=wordpress
examples-mysql-backup-1  | + export DB_PASS=wordpress
examples-mysql-backup-1  | + DB_PASS=wordpress
examples-mysql-backup-1  | + unset DB_PASS_FILE
examples-mysql-backup-1  | + file_env DB_NAMES
examples-mysql-backup-1  | + local var=DB_NAMES
examples-mysql-backup-1  | + local fileVar=DB_NAMES_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' wordpress ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' wordpress ']'
examples-mysql-backup-1  | + val=wordpress
examples-mysql-backup-1  | + export DB_NAMES=wordpress
examples-mysql-backup-1  | + DB_NAMES=wordpress
examples-mysql-backup-1  | + unset DB_NAMES_FILE
examples-mysql-backup-1  | + file_env DB_NAMES_EXCLUDE
examples-mysql-backup-1  | + local var=DB_NAMES_EXCLUDE
examples-mysql-backup-1  | + local fileVar=DB_NAMES_EXCLUDE_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export DB_NAMES_EXCLUDE=
examples-mysql-backup-1  | + DB_NAMES_EXCLUDE=
examples-mysql-backup-1  | + unset DB_NAMES_EXCLUDE_FILE
examples-mysql-backup-1  | + file_env DB_DUMP_FREQ 1440
examples-mysql-backup-1  | + local var=DB_DUMP_FREQ
examples-mysql-backup-1  | + local fileVar=DB_DUMP_FREQ_FILE
examples-mysql-backup-1  | + local def=1440
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=1440
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export DB_DUMP_FREQ=1440
examples-mysql-backup-1  | + DB_DUMP_FREQ=1440
examples-mysql-backup-1  | + unset DB_DUMP_FREQ_FILE
examples-mysql-backup-1  | + file_env DB_DUMP_BEGIN +0
examples-mysql-backup-1  | + local var=DB_DUMP_BEGIN
examples-mysql-backup-1  | + local fileVar=DB_DUMP_BEGIN_FILE
examples-mysql-backup-1  | + local def=+0
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=+0
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export DB_DUMP_BEGIN=+0
examples-mysql-backup-1  | + DB_DUMP_BEGIN=+0
examples-mysql-backup-1  | + unset DB_DUMP_BEGIN_FILE
examples-mysql-backup-1  | + file_env DB_DUMP_DEBUG
examples-mysql-backup-1  | + local var=DB_DUMP_DEBUG
examples-mysql-backup-1  | + local fileVar=DB_DUMP_DEBUG_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' true ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' true ']'
examples-mysql-backup-1  | + val=true
examples-mysql-backup-1  | + export DB_DUMP_DEBUG=true
examples-mysql-backup-1  | + DB_DUMP_DEBUG=true
examples-mysql-backup-1  | + unset DB_DUMP_DEBUG_FILE
examples-mysql-backup-1  | + file_env DB_DUMP_TARGET /backup
examples-mysql-backup-1  | + local var=DB_DUMP_TARGET
examples-mysql-backup-1  | + local fileVar=DB_DUMP_TARGET_FILE
examples-mysql-backup-1  | + local def=/backup
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=/backup
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export DB_DUMP_TARGET=/backup
examples-mysql-backup-1  | + DB_DUMP_TARGET=/backup
examples-mysql-backup-1  | + unset DB_DUMP_TARGET_FILE
examples-mysql-backup-1  | + file_env DB_DUMP_BY_SCHEMA
examples-mysql-backup-1  | + local var=DB_DUMP_BY_SCHEMA
examples-mysql-backup-1  | + local fileVar=DB_DUMP_BY_SCHEMA_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export DB_DUMP_BY_SCHEMA=
examples-mysql-backup-1  | + DB_DUMP_BY_SCHEMA=
examples-mysql-backup-1  | + unset DB_DUMP_BY_SCHEMA_FILE
examples-mysql-backup-1  | + file_env DB_DUMP_KEEP_PERMISSIONS true
examples-mysql-backup-1  | + local var=DB_DUMP_KEEP_PERMISSIONS
examples-mysql-backup-1  | + local fileVar=DB_DUMP_KEEP_PERMISSIONS_FILE
examples-mysql-backup-1  | + local def=true
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=true
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export DB_DUMP_KEEP_PERMISSIONS=true
examples-mysql-backup-1  | + DB_DUMP_KEEP_PERMISSIONS=true
examples-mysql-backup-1  | + unset DB_DUMP_KEEP_PERMISSIONS_FILE
examples-mysql-backup-1  | + file_env DB_RESTORE_TARGET
examples-mysql-backup-1  | + local var=DB_RESTORE_TARGET
examples-mysql-backup-1  | + local fileVar=DB_RESTORE_TARGET_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export DB_RESTORE_TARGET=
examples-mysql-backup-1  | + DB_RESTORE_TARGET=
examples-mysql-backup-1  | + unset DB_RESTORE_TARGET_FILE
examples-mysql-backup-1  | + file_env AWS_ENDPOINT_URL
examples-mysql-backup-1  | + local var=AWS_ENDPOINT_URL
examples-mysql-backup-1  | + local fileVar=AWS_ENDPOINT_URL_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export AWS_ENDPOINT_URL=
examples-mysql-backup-1  | + AWS_ENDPOINT_URL=
examples-mysql-backup-1  | + unset AWS_ENDPOINT_URL_FILE
examples-mysql-backup-1  | + file_env AWS_ENDPOINT_OPT
examples-mysql-backup-1  | + local var=AWS_ENDPOINT_OPT
examples-mysql-backup-1  | + local fileVar=AWS_ENDPOINT_OPT_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export AWS_ENDPOINT_OPT=
examples-mysql-backup-1  | + AWS_ENDPOINT_OPT=
examples-mysql-backup-1  | + unset AWS_ENDPOINT_OPT_FILE
examples-mysql-backup-1  | + file_env AWS_CLI_OPTS
examples-mysql-backup-1  | + local var=AWS_CLI_OPTS
examples-mysql-backup-1  | + local fileVar=AWS_CLI_OPTS_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export AWS_CLI_OPTS=
examples-mysql-backup-1  | + AWS_CLI_OPTS=
examples-mysql-backup-1  | + unset AWS_CLI_OPTS_FILE
examples-mysql-backup-1  | + file_env AWS_CLI_S3_CP_OPTS
examples-mysql-backup-1  | + local var=AWS_CLI_S3_CP_OPTS
examples-mysql-backup-1  | + local fileVar=AWS_CLI_S3_CP_OPTS_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export AWS_CLI_S3_CP_OPTS=
examples-mysql-backup-1  | + AWS_CLI_S3_CP_OPTS=
examples-mysql-backup-1  | + unset AWS_CLI_S3_CP_OPTS_FILE
examples-mysql-backup-1  | + file_env AWS_ACCESS_KEY_ID
examples-mysql-backup-1  | + local var=AWS_ACCESS_KEY_ID
examples-mysql-backup-1  | + local fileVar=AWS_ACCESS_KEY_ID_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export AWS_ACCESS_KEY_ID=
examples-mysql-backup-1  | + AWS_ACCESS_KEY_ID=
examples-mysql-backup-1  | + unset AWS_ACCESS_KEY_ID_FILE
examples-mysql-backup-1  | + file_env AWS_SECRET_ACCESS_KEY
examples-mysql-backup-1  | + local var=AWS_SECRET_ACCESS_KEY
examples-mysql-backup-1  | + local fileVar=AWS_SECRET_ACCESS_KEY_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export AWS_SECRET_ACCESS_KEY=
examples-mysql-backup-1  | + AWS_SECRET_ACCESS_KEY=
examples-mysql-backup-1  | + unset AWS_SECRET_ACCESS_KEY_FILE
examples-mysql-backup-1  | + file_env AWS_DEFAULT_REGION
examples-mysql-backup-1  | + local var=AWS_DEFAULT_REGION
examples-mysql-backup-1  | + local fileVar=AWS_DEFAULT_REGION_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export AWS_DEFAULT_REGION=
examples-mysql-backup-1  | + AWS_DEFAULT_REGION=
examples-mysql-backup-1  | + unset AWS_DEFAULT_REGION_FILE
examples-mysql-backup-1  | + file_env SMB_USER
examples-mysql-backup-1  | + local var=SMB_USER
examples-mysql-backup-1  | + local fileVar=SMB_USER_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export SMB_USER=
examples-mysql-backup-1  | + SMB_USER=
examples-mysql-backup-1  | + unset SMB_USER_FILE
examples-mysql-backup-1  | + file_env SMB_PASS
examples-mysql-backup-1  | + local var=SMB_PASS
examples-mysql-backup-1  | + local fileVar=SMB_PASS_FILE
examples-mysql-backup-1  | + local def=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export SMB_PASS=
examples-mysql-backup-1  | + SMB_PASS=
examples-mysql-backup-1  | + unset SMB_PASS_FILE
examples-mysql-backup-1  | + file_env TMP_PATH /tmp
examples-mysql-backup-1  | + local var=TMP_PATH
examples-mysql-backup-1  | + local fileVar=TMP_PATH_FILE
examples-mysql-backup-1  | + local def=/tmp
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=/tmp
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export TMP_PATH=/tmp
examples-mysql-backup-1  | + TMP_PATH=/tmp
examples-mysql-backup-1  | + unset TMP_PATH_FILE
examples-mysql-backup-1  | + file_env COMPRESSION gzip
examples-mysql-backup-1  | + local var=COMPRESSION
examples-mysql-backup-1  | + local fileVar=COMPRESSION_FILE
examples-mysql-backup-1  | + local def=gzip
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + local val=gzip
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + '[' '' ']'
examples-mysql-backup-1  | + export COMPRESSION=gzip
examples-mysql-backup-1  | + COMPRESSION=gzip
examples-mysql-backup-1  | + unset COMPRESSION_FILE
examples-mysql-backup-1  | + [[ -n true ]]
examples-mysql-backup-1  | + set -x
examples-mysql-backup-1  | + MYSQLDUMP_OPTS=
examples-mysql-backup-1  | + '[' -n wordpress ']'
examples-mysql-backup-1  | + DBUSER=-uwordpress
examples-mysql-backup-1  | + '[' -n wordpress ']'
examples-mysql-backup-1  | + DBPASS=-pwordpress
examples-mysql-backup-1  | + '[' -z mysql ']'
examples-mysql-backup-1  | + '[' -z 3306 ']'
examples-mysql-backup-1  | + COMPRESS=
examples-mysql-backup-1  | + UNCOMPRESS=
examples-mysql-backup-1  | + case $COMPRESSION in
examples-mysql-backup-1  | + COMPRESS=gzip
examples-mysql-backup-1  | + UNCOMPRESS=gunzip
examples-mysql-backup-1  | + EXTENSION=tgz
examples-mysql-backup-1  | + TMPDIR=/tmp/backups
examples-mysql-backup-1  | + TMPRESTORE=/tmp/restorefile
examples-mysql-backup-1  | + declare -A uri
examples-mysql-backup-1  | + [[ -n '' ]]
examples-mysql-backup-1  | ++ date
examples-mysql-backup-1  | + echo Starting at Tue Nov 1 16:43:12 UTC 2022
examples-mysql-backup-1  | + last_run=0
examples-mysql-backup-1  | Starting at Tue Nov 1 16:43:12 UTC 2022
examples-mysql-backup-1  | ++ date +%s
examples-mysql-backup-1  | + current_time=1667320992
examples-mysql-backup-1  | + freq_time=86400
examples-mysql-backup-1  | + '[' -n '' ']'
examples-mysql-backup-1  | + [[ +0 =~ ^\+(.*)$ ]]
examples-mysql-backup-1  | + waittime=0
examples-mysql-backup-1  | + target_time=1667320992
examples-mysql-backup-1  | + '[' -z '' ']'
examples-mysql-backup-1  | + sleep 0
examples-mysql-backup-1  | ++ date +%s
examples-mysql-backup-1  | + last_run=1667320992
examples-mysql-backup-1  | + exit_code=0
examples-mysql-backup-1  | + true
examples-mysql-backup-1  | + mkdir -p /tmp/backups
examples-mysql-backup-1  | + do_dump
examples-mysql-backup-1  | ++ date -u +%Y-%m-%dT%H:%M:%SZ
examples-mysql-backup-1  | + now=2022-11-01T16:43:12Z
examples-mysql-backup-1  | + '[' -n '' ']'
examples-mysql-backup-1  | + SOURCE=db_backup_2022-11-01T16:43:12Z.tgz
examples-mysql-backup-1  | + TARGET=db_backup_2022-11-01T16:43:12Z.tgz
examples-mysql-backup-1  | + '[' -d /scripts.d/pre-backup/ ']'
examples-mysql-backup-1  | + workdir=/tmp/backup.1
examples-mysql-backup-1  | + rm -rf /tmp/backup.1
examples-mysql-backup-1  | + mkdir -p /tmp/backup.1
examples-mysql-backup-1  | + NICE_CMD=
examples-mysql-backup-1  | + '[' '' = true ']'
examples-mysql-backup-1  | + '[' -n '' -a '' = true ']'
examples-mysql-backup-1  | + '[' '' = true ']'
examples-mysql-backup-1  | + [[ -n wordpress ]]
examples-mysql-backup-1  | + DB_LIST='--databases wordpress'
examples-mysql-backup-1  | + mysqldump -h mysql -P 3306 -uwordpress -pwordpress --databases wordpress
examples-mysql-backup-1  | mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
examples-mysql-backup-1  | + '[' 0 -ne 0 ']'
examples-mysql-backup-1  | + tar -C /tmp/backup.1 -cvf - .
examples-mysql-backup-1  | + gzip
examples-mysql-backup-1  | ./
examples-mysql-backup-1  | ./backup_2022-11-01T16:43:12Z.sql
examples-mysql-backup-1  | + '[' 0 -ne 0 ']'
examples-mysql-backup-1  | + rm -rf /tmp/backup.1
examples-mysql-backup-1  | + '[' 0 -ne 0 ']'
examples-mysql-backup-1  | + '[' -d /scripts.d/post-backup/ ']'
examples-mysql-backup-1  | + '[' -f /scripts.d/source.sh ']'
examples-mysql-backup-1  | + '[' -f /scripts.d/target.sh ']'
examples-mysql-backup-1  | + return 0
examples-mysql-backup-1  | + '[' 0 -ne 0 ']'
examples-mysql-backup-1  | + for target in ${DB_DUMP_TARGET}
examples-mysql-backup-1  | + backup_target /backup
examples-mysql-backup-1  | + local target=/backup
examples-mysql-backup-1  | + uri_parser /backup
examples-mysql-backup-1  | + uri=()
examples-mysql-backup-1  | + full=/backup
examples-mysql-backup-1  | + full=/backup
examples-mysql-backup-1  | + full=/backup
examples-mysql-backup-1  | + [[ / == \/ ]]
examples-mysql-backup-1  | + full=file://localhost/backup
examples-mysql-backup-1  | + [[ file://l == \f\i\l\e\:\/\/\/ ]]
examples-mysql-backup-1  | + pattern='^(([a-z0-9]{2,5})://)?((([^:\/]+)(:([^@\/]*))?@)?([^:\/?]+)(:([0-9]+))?)(\/[^?]*)?(\?[^#]*)?(#.*)?$'
examples-mysql-backup-1  | + [[ file://localhost/backup =~ ^(([a-z0-9]{2,5})://)?((([^:\/]+)(:([^@\/]*))?@)?([^:\/?]+)(:([0-9]+))?)(\/[^?]*)?(\?[^#]*)?(#.*)?$ ]]
examples-mysql-backup-1  | + full=file://localhost/backup
examples-mysql-backup-1  | + uri[uri]=file://localhost/backup
examples-mysql-backup-1  | + uri[schema]=file
examples-mysql-backup-1  | + uri[address]=localhost
examples-mysql-backup-1  | + uri[user]=
examples-mysql-backup-1  | + uri[password]=
examples-mysql-backup-1  | + uri[host]=localhost
examples-mysql-backup-1  | + uri[port]=
examples-mysql-backup-1  | + uri[path]=/backup
examples-mysql-backup-1  | + uri[query]=
examples-mysql-backup-1  | + uri[fragment]=
examples-mysql-backup-1  | + [[ file == \s\m\b ]]
examples-mysql-backup-1  | + [[ -n '' ]]
examples-mysql-backup-1  | + return 0
examples-mysql-backup-1  | + case "${uri[schema]}" in
examples-mysql-backup-1  | + mkdir -p /backup
examples-mysql-backup-1  | + cpOpts=-a
examples-mysql-backup-1  | + '[' -n true -a true = false ']'
examples-mysql-backup-1  | + cp -a /tmp/backups/db_backup_2022-11-01T16:43:12Z.tgz /backup/db_backup_2022-11-01T16:43:12Z.tgz
examples-mysql-backup-1  | + '[' 0 -ne 0 ']'
examples-mysql-backup-1  | + return 0
examples-mysql-backup-1  | + '[' 0 -ne 0 ']'
examples-mysql-backup-1  | + /bin/rm /tmp/backups/db_backup_2022-11-01T16:43:12Z.tgz
examples-mysql-backup-1  | ++ date +%s
examples-mysql-backup-1  | + current_time=1667320994
examples-mysql-backup-1  | + '[' -n '' ']'
examples-mysql-backup-1  | + '[' -n '' ']'
examples-mysql-backup-1  | ++ date +%s
examples-mysql-backup-1  | + current_time=1667320994
examples-mysql-backup-1  | + backup_time=2
examples-mysql-backup-1  | + freq_time_count=0
examples-mysql-backup-1  | + freq_time_count_to_add=1
examples-mysql-backup-1  | + extra_time=86400
examples-mysql-backup-1  | + target_time=1667407392
examples-mysql-backup-1  | + waittime=86398
examples-mysql-backup-1  | + sleep 86398
ploitivel commented 1 year ago

TU error esta en la sintaxis volumes:

deitch commented 1 year ago

thanks @ploitivel you are correct.