I have a file in which i have following content
2020-07-30 14:28:02|INFO|0||agent 1|CUpload|CUploadService
2020-07-30 14:28:02|INFO|0||agent 1|CUpload|CUpload
2020-07-30 14:28:04|INFO|0||agent 1|CUpload|CUplo
I need to write a script through which i can calculate the time difference. If time is more than 60 minutes since the file updated last time, i need to write the column 3 in another file.
I am able to get the date in right format but i dont know how to take difference so it will tell me if it has been more than 60 mins or not.
date +%Y-%m-%d" "%H:%M:%S
2020-07-30 14:47:24
I have placed two times in a file and took their difference but it came out to be zero
more 3.unl | awk -F '|' '{print$2 - $1}'