Sponsored Content
Top Forums UNIX for Dummies Questions & Answers script start and end of execution of time Post 302358722 by varontron on Sunday 4th of October 2009 10:50:03 AM
Old 10-04-2009
I'm not aware of a built in process, but a common practice is to echo 'date' output into logs redirected from the process.

Code:
echo `date +%Y%m%d%H%M%S` > mylog; myprocess >> mylog 2>&1 ;echo `date +%Y%m%d%H%M%S` >> mylog &

If you're looking for total run time, you could use 'time'

Code:
time myproc

will return something like the following

Code:
real	0m0.000s
user	0m0.000s
sys	0m0.000s

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Working out end time from start + elapsed

Hi, I'm writing a script and have become stuck trying to define a variable (COMP) by adding an elapsed time (ELAPSE e.g 00:55) to a start time (START e.g 23:50). Can anybody give me a solution as to how I can get a completion time in hh:mm from the variables above? thanks Richard (4 Replies)
Discussion started by: rik1551
4 Replies

2. Shell Programming and Scripting

Start time/end time and status of crontab job

Is there anyway to get the start time and end time / status of a crontab job which was just completed? Of course, we know the start time of the crontab job since we are scheduling. But I would like to know process start and time recorded somewhere or can be fetched from a command like 'ps'. ... (3 Replies)
Discussion started by: thambi
3 Replies

3. Shell Programming and Scripting

searching between start and end time

Hello All, Below mentioned is my log file. I want to make a script which ask for start time and then end time and then search particular word between those lines. Like start time:2 end time: 4 and then search all values starting from cell 84 between this time. Please Help ... (2 Replies)
Discussion started by: wakhan
2 Replies

4. Shell Programming and Scripting

How to get data between the start time and end time?

Hi, Can anyone help me how can I get the line that between the start time and end time. file1.txt 15/03/2009 20:45:03 Request: - Data of this line 15/03/2009 20:45:12 Response: - Data of this line 15/03/2009 22:10:40 Request: - Data of this line 15/03/2009 22:10:42 Response: - Data of... (1 Reply)
Discussion started by: tanit
1 Replies

5. Shell Programming and Scripting

How to calculate time difference between start and end time of a process!

Hello All, I have a problem calculating the time difference between start and end timings...! the timings are given by 24hr format.. Start Date : 08/05/10 12:55 End Date : 08/09/10 06:50 above values are in mm/dd/yy hh:mm format. Now the thing is, 7th(08/07/10) and... (16 Replies)
Discussion started by: smarty86
16 Replies

6. UNIX for Dummies Questions & Answers

Setup a cron job and specified the start and end time

Hi guys, How can I specify the start and end time of a cron job. And my start time and end time are specified by minutes. For example, I want to set up a cron runs every 3 minutes from 18:40 to midnight. How can i do this please? Many thanks Best regards, Clu (4 Replies)
Discussion started by: clu
4 Replies

7. Shell Programming and Scripting

Getting the Start, End time and duration using date command

Oracle Enterprise Linux We want to track how long a process takes to complete its execution. This is what we want in the schell script Before the process is started , get the time with date, hours and minutes execute the process After the process has ended , get the time with date,... (5 Replies)
Discussion started by: omega3
5 Replies

8. Shell Programming and Scripting

Remove lines between the start string and end string including start and end string Python

Hi, I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

9. Programming

DB2 Query to check table counts,start end time

Dear team I am using DB2 and wish to capture the ETL status on daily basis so that i can run the query and share the details in xls format to respective mail ids . Currently i am using below query but this displays table name and counts for latest run. select name ,CARD from... (0 Replies)
Discussion started by: Perlbaby
0 Replies
SG_RBUF(8)							     SG3_UTILS								SG_RBUF(8)

NAME
sg_rbuf - reads data using SCSI READ BUFFER command SYNOPSIS
sg_rbuf [--buffer=EACH] [--dio] [--help] [--mmap] [--quick] [--size=OVERALL] [--test] [--verbose] [--version] DEVICE sg_rbuf [-b=EACH_KIB] [-d] [-m] [-q] [-s=OVERALL_MIB] [-t] [-v] [-V] DEVICE DESCRIPTION
This command reads data with the SCSI READ BUFFER command and then discards it. Typically the data being read is from a disk's memory cache. It is assumed that the data is sourced quickly (although this is not guaranteed by the SCSI standards) so that it is faster than reading data from the media. This command is designed for timing transfer speeds across a SCSI transport. To fetch the data with a SCSI READ BUFFER command and optionally decode it see the sg_read_buffer utility. There is also a sg_write_buffer utility useful for downloading firmware amongst other things. This utility supports two command line syntaxes, the preferred one is shown first in the synopsis and explained in this section. A later section on the old command line syntax outlines the second group of options. OPTIONS
Arguments to long options are mandatory for short options as well. -b, --buffer=EACH where EACH is the number of bytes to be transferred by each READ BUFFER command. The default is the actual available buffer size returned by the READ BUFFER (descriptor) command. The maximum is the same as the default, hence this argument can only be used to reduce the size of each transfer to less than the device's actual available buffer size. -d, --dio use direct IO if available. This option is only available if the DEVICE is a sg driver device node (e.g. /dev/sg1). In this case the sg driver will attempt to configure the DMA from the SCSI adapter to transfer directly into user memory. This will eliminate the copy via kernel buffers. If not available then this will be reported and indirect IO will be done instead. -h, --help print usage message then exit. -m, --mmap use memory mapped IO if available. This option is only available if the DEVICE is a sg driver device node (e.g. /dev/sg1). In this case the sg driver will attempt to configure the DMA from the SCSI adapter to transfer directly into user memory. This will elimi- nate the copy via kernel buffers. -O, --old switch to older style options. -q, --quick only transfer the data into kernel buffers (typically by DMA from the SCSI adapter card) and do not move it into the user space. This option is only available if the DEVICE is a sg driver device node (e.g. /dev/sg1). -s, --size=OVERALL where OVERALL is the size of total transfer in bytes. The default is 200 MiB (200*1024*1024 bytes). The actual number of bytes transferred may be slightly less than requested since all transfers are the same size (and an integer division is involved rounding towards zero). -t, --time times the bulk data transfer component of this command. The elapsed time is printed out plus a MB/sec calculation. In this case "MB" is 1,000,000 bytes. The gettimeofday() system call is used internally for the time calculation. -v, --verbose increase level of verbosity. Can be used multiple times. -V, --version print out version string then exit. NOTES
This command is typically used on modern SCSI disks which have a RAM cache in their drive electronics. If no IO to the magnetic media, or slower devices like flash RAM, is involved then the disk may be able to source data fast enough to saturate the bandwidth of the SCSI transport. The bottleneck may then be the DMA element in the HBA, the Linux drivers or the host machine's hardware (e.g. speed of RAM). Various numeric arguments (e.g. OVERALL) may include multiplicative suffixes or be given in hexadecimal. See the "NUMERIC ARGUMENTS" sec- tion in the sg3_utils(8) man page. EXAMPLES
On the test system /dev/sg0 corresponds to a fast disk on a U2W SCSI bus (max 80 MB/sec). The disk specifications state that its cache is 4 MB. $ time ./sg_rbuf /dev/sg0 READ BUFFER reports: buffer capacity=3434944, offset boundary=6 Read 200 MiB (actual 199 MiB, 209531584 bytes), buffer size=3354 KiB real 0m5.072s, user 0m0.000s, sys 0m2.280s So that is approximately 40 MB/sec at 40 % utilization. Now with the addition of the "-q" option this throughput improves and the utiliza- tion drops to 0%. $ time ./sg_rbuf -q /dev/sg0 READ BUFFER reports: buffer capacity=3434944, offset boundary=6 Read 200 MiB (actual 199 MiB, 209531584 bytes), buffer size=3354 KiB real 0m2.784s, user 0m0.000s, sys 0m0.000s EXIT STATUS
The exit status of sg_rbuf is 0 when it is successful. Otherwise see the sg3_utils(8) man page. OLDER COMMAND LINE OPTIONS
The options in this section were the only ones available prior to sg3_utils version 1.23 . In sg3_utils version 1.23 and later these older options can be selected by either setting the SG3_UTILS_OLD_OPTS environment variable or using '--old' (or '-O) as the first option. -b=EACH_KIB where EACH_KIB is the number of Kilobytes (i.e. 1024 byte units) to be transferred by each READ BUFFER command. Similar to the --buffer=EACH option in the main description but the units are different. -d use direct IO if available. Equivalent to the --dio option in the main description. -m use memory mapped IO if available. Equivalent to the --mmap option in the main description. -N switch to the newer style options. -q only transfer the data into kernel buffers (typically by DMA from the SCSI adapter card) and do not move it into the user space. Equivalent to the --quick option in the main description. -s=OVERALL_MIB where OVERALL_MIB is the size of total transfer in Megabytes (1048576 bytes). Similar to the --size=OVERALL option in the main description but the units are different. -t times the bulk data transfer component of this command. Equivalent to the --time option in the main description. -v increase level of verbosity. Can be used multiple times. -V print out version string then exit. AUTHOR
Written by Doug Gilbert REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>. COPYRIGHT
Copyright (C) 2000-2007 Douglas Gilbert This software is distributed under the GPL version 2. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. SEE ALSO
sg_read_buffer, sg_write_buffer, sg_test_rwbuf(all in sg3_utils) sg3_utils-1.23 January 2007 SG_RBUF(8)
All times are GMT -4. The time now is 03:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy