Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@snh
Copy link
Member

@snh snh commented Apr 15, 2016

Adds an extra supported location for the backup config.

backup-utils will attempt to load the backup configuration from the following locations, in this order:

  1. $GHE_BACKUP_CONFIG (User configurable)
  2. $GHE_BACKUP_ROOT/backup.config (Root directory of backup-utils install)
  3. $HOME/.github-backup-utils/backup.config (New)
  4. /etc/github-backup-utils/backup.config

This is useful for situations where the user running backup-utils does not have write access to the install location or /etc, and does not wish to set an environment variable. Users of the Debian package are the main target audience for this PR.

/cc @github/backup-utils

# and then falling back to the system location.
config_found=false
for f in "$GHE_BACKUP_CONFIG" "/etc/github-backup-utils/backup.config"; do
for f in "$GHE_BACKUP_CONFIG" "$HOME/github-backup-utils/backup.config" "/etc/github-backup-utils/backup.config"; do
Copy link
Contributor

@tjl2 tjl2 Apr 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience, it'd be fairly standard behaviour for a config file in a user's home directory to override the settings in a system config file. Given that, would it be an idea to switch the order of the $HOME/github-backup-utils/backup.config and /etc/github-backup-utils/backup.config files in this loop?

EDIT: I hadn't seen the break that follows, later in the code 😊

@rubiojr
Copy link
Member

rubiojr commented Apr 15, 2016

@snh using a hidden dir is perhaps a bit more common ($HOME/.github-backup-utils/backup.config). What do you think?

@snh
Copy link
Member Author

snh commented Apr 16, 2016

@rubiojr 👍

@rubiojr
Copy link
Member

rubiojr commented Apr 16, 2016

👍

@rubiojr
Copy link
Member

rubiojr commented Apr 18, 2016

:shipit:

@snh snh merged commit f774235 into master Apr 18, 2016
@snh snh deleted the snh/home-dir-config branch April 18, 2016 23:22
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

Successfully merging this pull request may close these issues.

4 participants