diff --git a/plugins/restful/log_handle.c b/plugins/restful/log_handle.c index 9f132261..2b07f970 100644 --- a/plugins/restful/log_handle.c +++ b/plugins/restful/log_handle.c @@ -62,6 +62,8 @@ void handle_logs_files(nng_aio *aio) return; } + rv = system("rm -rf /tmp/neuron_debug.tar.gz"); + nlog_warn("remove old neuron_debug.tar.gz, rv: %d", rv); /* tar the neuron directory */ rv = system("tar -zcvf /tmp/neuron_debug.tar.gz ../neuron"); if (rv == -1) { @@ -72,7 +74,7 @@ void handle_logs_files(nng_aio *aio) return; } else { if (WIFEXITED(rv)) { - if (WEXITSTATUS(rv) != 0) { + if (WEXITSTATUS(rv) < 0) { nlog_error("failed to create neuron_debug.tar.gz, rv: %d", WEXITSTATUS(rv)); NEU_JSON_RESPONSE_ERROR(NEU_ERR_COMMAND_EXECUTION_FAILED, {