- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Execution Time
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 04:16 AM
12-17-2003 04:16 AM
Execution Time
I execute 15 shell scripts from one main shell script. Main shell scripts writes log file for all other child scripts.
Now i need to include the start time (date,hours,mins and seconds) and end time
and total execution time of each script.
So when i open the main log file it should
say
OUTPUT of LOG.
Script1 started at 12/16/2003 11:30:23AM
x
y
z
Script1 Ended at 12/16/2003 11:45:23AM
Total Execution time 0 hrs 15 mins 0 seconds.
Any help?
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 04:19 AM
12-17-2003 04:19 AM
Re: Execution Time
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 04:20 AM
12-17-2003 04:20 AM
Re: Execution Time
You could simply "echo `date` > LOG" at the start and end and use the "time" command to get the durations.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 04:22 AM
12-17-2003 04:22 AM
Re: Execution Time
echo "starting Execution at 1date1" >> /log_file
Echo "completed execution at `date`" >> /log_file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 04:25 AM
12-17-2003 04:25 AM
Re: Execution Time
#!/usr/bin/sh
echo "Script started at `date`"
timex script #grep the real time value here to TIME
echo "Script ended at `date`"
echo total time $TIME
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 04:52 AM
12-17-2003 04:52 AM
Re: Execution Time
for the elapsed time in a script, try the SECONDS varable of the korn shell:
#!/usr/bin/sh
sleep 3
echo Total execution time: $SECONDS seconds
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 05:54 AM
12-17-2003 05:54 AM
Re: Execution Time
Thanks a lot
Raj