Merge pull request #1827 from neoascetic/flush_file_cache

Ability to flush file-based cache storage
Exit with non-zero if command fails, useful in scripting and CI
Merge branch 'return_non_0_on_command_fail' into master-with-fixes