… --dbpath which bypasses mongod, so this code is useless
Code cleanup: * better way to handle EXTERNAL_CONFIG is to just load it if its there * date +%N doesnt work on osx and presumably *bsd, use Hour:Minute instead of nanoseconds * mkdir -p tests for file existence, so do it once and exit out because it cant create them * sed -i doesnt work on osx and presumably *bsd the way it does in linux, workaround by detecting * connect to the actual mongo host specified when trying to detect secondaries * fixed compression() to be a bit cleaner, and not 'cd' into a dir without going back to prev * more indentation issues in the backup part (whitespace) * BACKUPS: all backups did the same thing but just used a different file, so I simplified this with a 'variable' * sed could be run before the if statement eliminating duplicates New Stuff: * created shellout function to have a nice way of exiting if things go wrong (ie. cant create dirs)
…hange the script sources
A proper exit code is needed for monitoring of the success or failure of the backup attempt by services like probyapp.com. It is possible to get mongodump to not print to STDERR by making sure that all options are configured correctly (for example, disabling replication finding if not using replica sets).
Signed-off-by: Krzysztof Wilczynski <firstname.lastname@example.org>