LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 03-16-2009, 07:38 AM   #1
dellroxy
Member
 
Registered: Jun 2008
Posts: 31

Rep: Reputation: 15
Need help about process control


hi all
i am working under system run some schedule script at specify time
what is need
how to know each duration time for each process

log format logname_dd_mm_yyyy


Note:-
I don't know any thing about timestamp programming so if there is the only way for what i want
please provide me with any web site explain what is timestamp and how does it work and how to programming it

Last edited by dellroxy; 03-16-2009 at 07:42 AM.
 
Old 03-16-2009, 08:11 AM   #2
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
I'm not sure exactly what you mean but I think I will take a guess.

To be able to find out how long it takes to complete the command you would use the time command as a prefix to your process. Here is an example of me checking how long it takes to backup the directories /root and /home to the file /backup.tgz

[root@rpmdev.pantek.com /]# time tar -zcf backup.tgz root home

real 0m46.977s
user 0m14.625s
sys 0m10.857s
[root@rpmdev.pantek.com /]#
 
Old 03-16-2009, 08:21 AM   #3
dellroxy
Member
 
Registered: Jun 2008
Posts: 31

Original Poster
Rep: Reputation: 15
hi kentyler:-
what i mean
1- i have some script run at scheduler time
2- this script take a duration time
3- this script put log into scecific folder (the log doesn't include start time and the end time)

what i need if i want to know the duration time for each script what can i do
 
Old 03-16-2009, 12:35 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
You can just do what kentyler rightly suggested, i.e. prefixing the script by the time command.
 
Old 03-19-2009, 08:47 AM   #5
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
If you would like to have the output in a seperate file you would do this:

/usr/bin/time -o timescripttakes.txt scriptname.sh

To append the time it takes to execute your script to your current scripts log you would use the following

/usr/bin/time -a -o scriptoutputlog.txt scriptname.sh

Note that the builtin version of time without full path does not accept options.
 
Old 03-23-2009, 06:23 PM   #6
dellsh
LQ Newbie
 
Registered: Mar 2009
Posts: 2

Rep: Reputation: 0
hi kentyler:-
i am new user for unix i am also using open solaris 5.11 could you please explain
Code:
[root@rpmdev.pantek.com /]# time tar -zcf backup.tgz root home

real 0m46.977s
user 0m14.625s
sys 0m10.857s
[root@rpmdev.pantek.com /]#
i didn't under stand what exeactly this command do

for the first thing i am try to using man pages put really i can't under stand



if i am using the command like that you right
# time tar -zcf backup.tar root home
the time command recoding the time for tar command and when i want to return the tar command time i will using time
really i can't understand


real 0m46.977s
user 0m14.625s
sys 0m10.857s
what is this output
 
Old 03-24-2009, 01:27 AM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
The first line (real 0m46.877s) is precisely telling the duration time it took too execute the command (tar ...). It means the tar took 0 minute, 46 seconds and 977 thousandths of seconds.
The remaining two lines relate to how the CPU was loaded by the tar command.
 
Old 03-24-2009, 05:26 AM   #8
dellsh
LQ Newbie
 
Registered: Mar 2009
Posts: 2

Rep: Reputation: 0
thanks jlliagre for explaination
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Me!! (Process control block) Jei13 Linux - Newbie 2 08-03-2008 02:28 AM
time control process sunlinux Programming 4 12-16-2006 08:44 PM
Process Table-Process Control Block sarahmencer Linux - General 1 01-09-2006 09:14 PM
Process control...? kleptophobiac Linux - General 2 09-25-2004 10:03 AM
Regaining Process Control mikeyt_333 Linux - General 5 03-21-2002 02:21 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 07:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration