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

Problem with Variables and backup_mysql_password in shell script #17

Closed
manuelgerber opened this issue May 28, 2020 · 3 comments
Closed
Labels

Comments

@manuelgerber
Copy link

manuelgerber commented May 28, 2020

Hi Jeff,

i found an issue in the mysql backup shell script.
The variable $MYSQL_CREDENTIALS contains the mysql user and password. The password is written into the variable with quotation marks. I think this is a problem when the Variable call in a Commandline.

DATABASES=`$MYSQL $MYSQL_CREDENTIALS -e "SHOW DATABASES;" | grep -Ev '(Database|information_schema|performance_schema|mysql)'

The password can then not be interpreted.

That Comman line works for me.

$MYSQLDUMP {% if backup_mysql_credential_file != '' %} --defaults-extra-file={{ backup_mysql_credential_file }} {% else %} -u {{ backup_mysql_user }} -p'{{ backup_mysql_password }}' {% endif %} --single-transaction --quick --lock-tables=false {{backup_database_name}} | gzip -f -6 > {{ backup_path }}/databases/{{backup_database_name}}_$TIMESTAMP.sql.gz

By the way. I have expand the shell script with a little file versioning. Files that older 10 days will be delete:-)

find {{ backup_path }}/databases -mtime +10 -type f -delete
$RSYNC -aqz -e 'ssh {{ backup_remote_connection_ssh_options }}' {{ backup_path }}/databases $REMOTE:{{ backup_remote_base_path }}/{{ backup_identifier }} --delete

Beste Regards
Manuel

P.S. The Role is very usefull. Thank you!

@thiagogomesverissimo
Copy link

Same behavior here:

  • $MYSQL $MYSQL_CREDENTIALS - not working
  • /usr/bin/mysql -u example -p'pass' -working

@stale
Copy link

stale bot commented Aug 30, 2020

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Aug 30, 2020
@stale
Copy link

stale bot commented Sep 29, 2020

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

@stale stale bot closed this as completed Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants