From: mivirl <> Date: Wed, 7 Feb 2024 16:57:01 +0000 (-0600) Subject: server: Remove .log and .cmdlog suffixes X-Git-Url: http://mivirl.dev/git/?a=commitdiff_plain;h=90a92e90fb82e2bc54fbfbb79e3c2c020da8580d;p=remote-logging.git server: Remove .log and .cmdlog suffixes Removed suffixes from uploaded files since the prefixes already identify the type of file, and many logs already have the .log suffix which results in names like "L__service.log.log". --- diff --git a/README.md b/README.md index 3a1d7a1..159099a 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,9 @@ server in `srv/clients/` with the following naming scheme: - `_info.txt` - Contains basic information about the client - `_processes.log` - Log of processes as they are run on the client - `F__filepath` - Files that are transferred once -- `L__logpath.log` - Log files that are continuously transferred, new lines are +- `L__logpath` - Log files that are continuously transferred, new lines are transferred as they are written on the client -- `C__commandname.cmdlog` - Command output, continuously transferred +- `C__commandname` - Command output, continuously transferred Logs can be monitored as they come in using `lnav`: diff --git a/src/server.sh b/src/server.sh index b732d08..0a9bc89 100644 --- a/src/server.sh +++ b/src/server.sh @@ -139,16 +139,16 @@ while read -r COMMAND; do elif [ "$COMMAND" = "log" ]; then echo -n "Filename: " read -r TMPFILENAME - verify_input "L__${TMPFILENAME}.log" - print_status write_to_file "L__${TMPFILENAME}.log" + verify_input "L__${TMPFILENAME}" + print_status write_to_file "L__${TMPFILENAME}" unset TMPFILENAME elif [ "$COMMAND" = "command" ]; then echo -n "Filename: " read -r TMPFILENAME - verify_input "C__${TMPFILENAME}.cmdlog" - print_status write_to_file "C__${TMPFILENAME}.cmdlog" + verify_input "C__${TMPFILENAME}" + print_status write_to_file "C__${TMPFILENAME}" unset TMPFILENAME