Skip to content

emanuel-minetti/addDateToLog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

addDateToLog

A bash script to add dates to log files

Scenario

Suppose you have a programm runninig that writes a log file but it misses to write dates to its entries. If the entries consist of a single line of text and you want to add Dates to each written line, then here you find the solution.

Installing

Make sure you have git installed. Then move to a directory where you want the script to be installed. Execute:

git clone https://github.com/emanuel-minetti/addDateToLog.git

Change to the newly created directory:

cd addDateToLog

Replace ./test.log in addDate with /path/to/LogFile.log if /path/to/LogFile.log the path to your log file and ./newTest.log with /path/to/NewLogFile.log. Be carefull: There is a long line in addDate! If You use nano to edit the file, use nano -w!

Make the script executable:

chmod a+x addDate

Running and Stopping

Run the script by

./addLog

Stop it by

killall addDate

About

A bash script to add dates to log files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages