ShahriyarR / MySQL-AutoXtraBackup

MySQL-AutoXtraBackup commandline tool written in Python 3 based on Percona XtraBackup
https://autoxtrabackup.azepug.az/
MIT License
140 stars 79 forks source link

Why is the conf not in /etc/ now? #336

Closed BarbzYHOOL closed 3 years ago

BarbzYHOOL commented 5 years ago

Every program puts its configuration file in /etc/ but now I'm forced to use --defaults_file option to specify my /etc/bck.cnf

I feel like it's worse and unintuitive. It adds more work when we want to automate everything (imagine with Ansible, with a cron script etc)

ShahriyarR commented 5 years ago

It was originally in /etc/ but now it is in ~/.autoxtrabackup/ folder as autoxtrabackup.cnf There was a proposal that in general every program is going to create hidden folder in home folder and will put log and config files inside this folder. So I have implemented it and it seems to be valid and reasonable to stay on this approach.

BarbzYHOOL commented 5 years ago

files in /home/user are specific to the user

in general there is either only 1 config in /etc/ or 2 config files, one in /etc/ and one in /home/user/ that overrides the /etc/ (for example for ssh_conf for the ssh client)

also the ~/.autoxtrabackup/ dir is most likely going to be /root/.autoxtrabackup (when we discussed it few days ago ^^) so unless someone makes a specific user and add it to the mysql group and run the script with that user, it will always be in /root/ :(

ShahriyarR commented 5 years ago

I am aware of that but still we have 2 choices:

Previous community member as you proposed second, now you are asking for first approach :) So what to do? Implement both?)

BarbzYHOOL commented 5 years ago

" So what to do? Implement both?)"

yes, i think both would be nice and with the one in the user's folder overwriting the one in /etc/ (but then it must not be generated in /home/user if it's generated in /etc/ or if it's generated in /etc/ then in /home/user it is named autoxtrabackup.conf.dist or .default and it's not read)

@ShahriyarR

Arlington1985 commented 5 years ago

I don't think using root user for application is a best practice and that's why it's not applicable from my point of view put default config file under folder which has read access of all users. I am voting to current mechanism 👍