micahwedemeyer/automongobackup — pull request #15 by kmullin (2012-04-24 21:44:06+00:00)
Title: cleaned up alot of code

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)