Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql-backup command description all over logs #393

Closed
martkaczmarek opened this issue Dec 10, 2024 · 3 comments
Closed

mysql-backup command description all over logs #393

martkaczmarek opened this issue Dec 10, 2024 · 3 comments

Comments

@martkaczmarek
Copy link
Contributor

martkaczmarek commented Dec 10, 2024

I'm using Docker container, release 1.0.0.
After starting up the container, here is the docker log output:
docker compose logs db-backup

db-backup-1  | Backup or restore one or more mysql-compatible databases.
db-backup-1  |          In addition to the provided command-line flag options and environment variables,
db-backup-1  |          when using s3-storage, supports the following AWS options:
db-backup-1  |
db-backup-1  |          AWS_ACCESS_KEY_ID: AWS Key ID
db-backup-1  |          AWS_SECRET_ACCESS_KEY: AWS Secret Access Key
db-backup-1  |          AWS_REGION: Region in which the bucket resides
db-backup-1  |          AWS_ENDPOINT_URL: Endpoint URL to use instead of default s3.<region>.amazonaws.com
db-backup-1  |          AWS_PATH_STYLE: Use path-style URLs for S3 requests instead of virtual-hosted-style URLs
db-backup-1  |
db-backup-1  | Usage:
db-backup-1  |   mysql-backup [command]
db-backup-1  |
db-backup-1  | Available Commands:
db-backup-1  |   completion  Generate the autocompletion script for the specified shell
db-backup-1  |   dump        backup a database
db-backup-1  |   help        Help about any command
db-backup-1  |   prune       prune older backups
db-backup-1  |   restore     restore a dump
db-backup-1  |
db-backup-1  | Flags:
db-backup-1  |       --aws-access-key-id string       Access Key for s3 and s3 interoperable systems; ignored if not using s3.
db-backup-1  |       --aws-endpoint-url string        Specify an alternative endpoint for s3 interoperable systems e.g. Digitalocean; ignored if not using s3.
db-backup-1  |       --aws-path-style                 Use path-style addressing of buckets instead of default virtual-host-style; ignored if not using s3.
db-backup-1  |       --aws-region string              Region for s3 and s3 interoperable systems; ignored if not using s3.
db-backup-1  |       --aws-secret-access-key string   Secret Access Key for s3 and s3 interoperable systems; ignored if not using s3.
db-backup-1  |       --config-file string             config file to use, if any; individual CLI flags override config file
db-backup-1  |       --debug                          set log level to debug, equivalent of --verbose=1; if both set, --version always overrides
db-backup-1  |   -h, --help                           help for mysql-backup
db-backup-1  |       --pass string                    password for database server
db-backup-1  |       --port int                       port for database server (default 3306)
db-backup-1  |       --server string                  hostname for database server
db-backup-1  |       --smb-domain string              SMB domain
db-backup-1  |       --smb-pass string                SMB username
db-backup-1  |       --smb-user string                SMB username
db-backup-1  |       --trace-stderr                   trace to stderr, in addition to any configured telemetry
db-backup-1  |       --user string                    username for database server
db-backup-1  |   -v, --verbose int                    set log level, 1 is debug, 2 is trace
db-backup-1  |
db-backup-1  | Use "mysql-backup [command] --help" for more information about a command.
db-backup-1  | Backup or restore one or more mysql-compatible databases.
db-backup-1  |          In addition to the provided command-line flag options and environment variables,
db-backup-1  |          when using s3-storage, supports the following AWS options:
db-backup-1  |
db-backup-1  |          AWS_ACCESS_KEY_ID: AWS Key ID
db-backup-1  |          AWS_SECRET_ACCESS_KEY: AWS Secret Access Key
db-backup-1  |          AWS_REGION: Region in which the bucket resides
db-backup-1  |          AWS_ENDPOINT_URL: Endpoint URL to use instead of default s3.<region>.amazonaws.com
db-backup-1  |          AWS_PATH_STYLE: Use path-style URLs for S3 requests instead of virtual-hosted-style URLs
db-backup-1  |
db-backup-1  | Usage:
db-backup-1  |   mysql-backup [command]
db-backup-1  |
db-backup-1  | Available Commands:
db-backup-1  |   completion  Generate the autocompletion script for the specified shell
db-backup-1  |   dump        backup a database
db-backup-1  |   help        Help about any command
db-backup-1  |   prune       prune older backups
db-backup-1  |   restore     restore a dump
db-backup-1  |
db-backup-1  | Flags:
db-backup-1  |       --aws-access-key-id string       Access Key for s3 and s3 interoperable systems; ignored if not using s3.
db-backup-1  |       --aws-endpoint-url string        Specify an alternative endpoint for s3 interoperable systems e.g. Digitalocean; ignored if not using s3.
db-backup-1  |       --aws-path-style                 Use path-style addressing of buckets instead of default virtual-host-style; ignored if not using s3.
db-backup-1  |       --aws-region string              Region for s3 and s3 interoperable systems; ignored if not using s3.
db-backup-1  |       --aws-secret-access-key string   Secret Access Key for s3 and s3 interoperable systems; ignored if not using s3.
db-backup-1  |       --config-file string             config file to use, if any; individual CLI flags override config file
db-backup-1  |       --debug                          set log level to debug, equivalent of --verbose=1; if both set, --version always overrides
db-backup-1  |   -h, --help                           help for mysql-backup
db-backup-1  |       --pass string                    password for database server
db-backup-1  |       --port int                       port for database server (default 3306)
db-backup-1  |       --server string                  hostname for database server
db-backup-1  |       --smb-domain string              SMB domain
db-backup-1  |       --smb-pass string                SMB username
db-backup-1  |       --smb-user string                SMB username
db-backup-1  |       --trace-stderr                   trace to stderr, in addition to any configured telemetry
db-backup-1  |       --user string                    username for database server
db-backup-1  |   -v, --verbose int                    set log level, 1 is debug, 2 is trace
db-backup-1  |
db-backup-1  | Use "mysql-backup [command] --help" for more information about a command.
...this goes on and on a dozen times

Here's the relevant docker-compose part:

  db-backup:
    image: databack/mysql-backup:1.0.0
    restart: always
    volumes:
     - ./post-backup-scripts:/scripts.d/post-backup:ro
     - ./wp_data:/wp_data:ro
     - .:/docker_folder:ro
    environment:
     - DB_DUMP_TARGET=${DB_BACKUP_DIR}
     - DB_USER=${WORDPRESS_DB_USER}
     - DB_PASS=${WORDPRESS_DB_PASSWORD}
     - DB_SERVER=${WORDPRESS_DB_HOST}
     - DB_NAMES=${WORDPRESS_DB_NAME}
     - RESTORE_DATABASE=${WORDPRESS_DB_NAME}
     - DB_DUMP_SAFECHARS=true
     - DB_DUMP_BEGIN=${DB_BACKUP_BEGIN-0000} # UTC
     - DB_DUMP_FREQUENCY=${DB_BACKUP_FREQUENCY-1440} # in minutes, default = 1 day
     - DB_DUMP_RETENTION=${DB_BACKUP_RETENTION}
     - SMB_USER=${DB_BACKUP_SMB_USER}
     - SMB_PASS=${DB_BACKUP_SMB_PASS}
    depends_on:
      - db

and the .env:

WORDPRESS_DB_HOST=<value>
WORDPRESS_DB_USER=<value>
WORDPRESS_DB_PASSWORD=<value>
WORDPRESS_DB_NAME=<value>

DB_BACKUP_BEGIN=2000 # UTC
DB_BACKUP_RETENTION=7d
DB_BACKUP_FREQUENCY=1440 #in minutes
DB_BACKUP_SMB_USER=<value>
DB_BACKUP_SMB_PASS=<value>
DB_BACKUP_DIR=<value>

I recently switched to 1.0.0 and just now noticed these logs. The backups themselves are working fine. I can't help but think that I misplaced some env, but I can't find anything wrong here.

The text is there right after starting up the container.

@martkaczmarek
Copy link
Contributor Author

And of course I found the issue 5 minutes after posting: I was missing the command: dump line in docker-compose file.
But still, kinda weird it was working without it.

@deitch
Copy link
Collaborator

deitch commented Dec 12, 2024

I was missing the command: dump

That is it.

There have been some discussions about making the command: dump be a default. See for example the discussion at the end of #372.

It makes things easier as a container, a bit harder as a standalone, which is not what we want. My basic view is that if this is a onetime conversion pain from people who were used to the old way, we can live with it. One-time small cost from pre-v1 to v1 is acceptable; if it is ongoing, then it is broken and needs to be fixed. As of now, I see this is a one-time pain, rather than a confusing UX. I could be convinced otherwise.

@martkaczmarek
Copy link
Contributor Author

Well, while this may be an ongoing discussion, I think my case isn't really an issue, it was just not sticking to the documentation for a current version. So my particular issue is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants