•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,418 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,597 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 1524 | Replies: 1
![]() |
•
•
Join Date: Apr 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi All,
We now have a Log file which has time stamps of all the scripts ran. It has start
time and end time. I now have a requirement to send mail to the Admin after the script finishes running.
Can some one help me with a Script which will send mail with Start time and
End time of the script by picking the lines from the below sample log or in any other way which i can tell my script to mail start and end time after it finish running?
swift.log
SWIFT Europe Update Starting for: 04/23/07 21:05:44
SWIFT Europe Update Ending for: 04/23/07 21:08:01
Swift NA Begining : 04/24/07 00:28:22
Swift NA Ending : 04/24/07 00:28:29
Swift AUS Begining : 04/24/07 00:59:17
Swift AUS Ending : 04/24/07 00:59:25
Thanks
Srikanth GR
We now have a Log file which has time stamps of all the scripts ran. It has start
time and end time. I now have a requirement to send mail to the Admin after the script finishes running.
Can some one help me with a Script which will send mail with Start time and
End time of the script by picking the lines from the below sample log or in any other way which i can tell my script to mail start and end time after it finish running?
swift.log
SWIFT Europe Update Starting for: 04/23/07 21:05:44
SWIFT Europe Update Ending for: 04/23/07 21:08:01
Swift NA Begining : 04/24/07 00:28:22
Swift NA Ending : 04/24/07 00:28:29
Swift AUS Begining : 04/24/07 00:59:17
Swift AUS Ending : 04/24/07 00:59:25
Thanks
Srikanth GR
If you are writing to the logfile in the following manner
Then change it as follows (for a really quick fix):
scriptname >> logfilenameThen change it as follows (for a really quick fix):
scriptname | tee -a logfilename | mailx -s "scriptname" email@address Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Using Shell Script how to send mail automatically (Shell Scripting)
- Learning PHP but problem with script (PHP)
- How can I send variables from a PHP script to another URL using POST without......... (PHP)
- HElP script for send mail (Shell Scripting)
- Help "sell script to send a mail" (Shell Scripting)
- send mail via microsoft outlook (Windows Software)
- Cannot Send E-mail (OS X)
Other Threads in the Shell Scripting Forum
- Previous Thread: functions in bash
- Next Thread: Printing file access permission....



Linear Mode