Skip to content

Conversation

@MikeMcQuaid
Copy link
Contributor

Do this instead of just enabling it unconditionally.

Fixes #62.

CC @rtomayko for review.

Do this instead of just enabling it unconditionally.

Fixes #62.
Copy link
Contributor

Choose a reason for hiding this comment

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

Quote the path name here just in case GHE_REMOTE_DATA_DIR has spaces in dev / test environments.

@rtomayko
Copy link
Contributor

rtomayko commented Dec 5, 2014

Nice. Diff looks good to me the one quoting issue aside. 👍

Handle the case in which it might have spaces.
MikeMcQuaid added a commit that referenced this pull request Dec 9, 2014
ghe-restore: check maintenance mode is enabled.
@MikeMcQuaid MikeMcQuaid merged commit fc8d2d8 into github:master Dec 9, 2014
@MikeMcQuaid MikeMcQuaid deleted the ghe-restore-check-maintenance branch December 9, 2014 11:39
snh pushed a commit that referenced this pull request Aug 7, 2017
* Skip hookshot es backup on pre 2.0

* Only restore hookshot es backup to cluster

* Correct minor spelling error

* Backup and restore ca certificates

* Don't suppress output

* Check if command exists so to expose errors

* Backup not restore

* Use which instead of type to verify existence

* Silence test output

* Run bm_file_path first

* Revert removal of bm_file_path from bm_start

In case bm.sh is used outside or independently of ghe-backup or
ghe-restore, such as when testing backup utilities individual
components.

* Rename bm_file_path to bm_init

Should make the intention a bit more clear.

* Add --version flag to all commands

* Check for missing GHE_DATA_DIR variable in config

```
$ ./bin/ghe-backup
./bin/../share/github-backup-utils/ghe-backup-config: line 82: [: !=: unary operator expected
mkdir: : No such file or directory
```

These errors occur because `GHE_DATA_DIR` is not defined before running`ghe-backup-config`, causing it to throw errors.

```
$ ./share/github-backup-utils/ghe-backup-config
./share/github-backup-utils/ghe-backup-config: line 82: [: !=: unary operator expected
mkdir: : No such file or directory
Error: GHE_DATA_DIR  does not exist.
```

This change adds a test to ensure `GHE_DATA_DIR` is defined, else return an appropriate error.

```
$ ./bin/ghe-backup
Error: GHE_DATA_DIR not set in config file.
$ ./share/github-backup-utils/ghe-backup-config
Error: GHE_DATA_DIR not set in config file.
```

* Check backup-utils are not being run on GitHub Enterprise host

Customers occasionally configure backup-utils to run on the GitHub Enterprise
host or HA replica. Apart from losing their backup if the appliance is lost,
it leads to running out of disk space issues.

This PR adds a check for this case and returns an informative error to guide the user.
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.

ghe-restore should require maintenance mode be enabled prior to restoring

2 participants