Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

FMallon/LogCommand

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
9 Commits
 
 
 
 
 
 

Repository files navigation

LogCommand

A Bash Script to make logging commands and their outputs easier - even where output may not be thrown to the Command Line

Written to make logging easier, especially as the outputs of commands I was using weren't showing output.

This script is especially better when used with https://github.com/FMallon/LogAppend

Although, one could use 'sudo tee -a' also, or whatever.

Usage (where alias of script is set to 'logcom'):

  1. logcom "sudo blkdiscard $DISK_NAME" | sudo tee -a /log/logfile.log

or even better, using LogAppend (https://github.com/FMallon/LogAppend):

  1. log --begin /log/logfile.log
  2. logcom "sudo blkdiscard $DISK_NAME" | log -a /log/logfile.log
  3. log --end /log/logfile.log

This will output the command, its output, and exit status to a logfile. If the command doesn't output to the terminal as the one above, LogCommand will log success or failure based-off the exit status.

This script was made because I was sanitizing disks that I needed to log, and nvme-cli and blkdiscard do not throw output upon running - output that I needed to prove that these commands have been successfully ran. This script aids to mitigate that.

About

A Bash Script to make logging commands and their outputs easier - even where output may not be thrown to the Command Line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.