Unix/Linux Go Back    

UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Determine uniqueness of pid to name output files

UNIX for Dummies Questions & Answers


Thread Tools Search this Thread Display Modes
Old Unix and Linux 04-18-2013
vkumbhakarna vkumbhakarna is offline
Registered User
Join Date: Oct 2006
Last Activity: 1 July 2013, 4:54 PM EDT
Posts: 12
Thanks: 9
Thanked 0 Times in 0 Posts
Determine uniqueness of pid to name output files


We've a process on AIX UNIX server which is executed by multiple uses during a day. I wish to create a log file for every time the process is executed. I wish to know how unique are PID(s) on AIX UNIX servers if I were to name the log files with <date> and <PID>?

E.g. If I create my output files having the details such as
`date +%Y%m%d`_${$}_out.csv

With my limited understanding of UNIX and from what I've read on the forum http://www.unix.com/unix-advanced-expert-users/2896-obtaining-process-id-pid.html AIX system sequentially assigns a limited set of PIDs and re-utilizes them as and when processes get freed and slot is available for allocation by dispatcher.

Please suggest a suitable way to uniquely identify the process execution during the day. I am also considering adding datetime hh:mm:ss to the log name to uniquely identify the same E.g. change log file name to
 `date +%Y%m%d_%H%M%S`_${$}_out.csv


Last edited by vkumbhakarna; 04-18-2013 at 06:25 PM..
Sponsored Links
Old Unix and Linux 04-18-2013
hanson44 hanson44 is offline
Registered User
Join Date: Mar 2013
Last Activity: 12 May 2013, 11:33 PM EDT
Posts: 858
Thanks: 18
Thanked 183 Times in 178 Posts
Yes, as you concluded, a pid is NOT unique within a 24 hour period. My understanding is they reach a maximum value, go back to lowest open value, and then start increasing again, reusing open slots are available.

Yes, the addition of "date +%Y%m%d_%H%M%S" to the file name will make the file name unique. That seems like a very good way, probably the best way.
The Following User Says Thank You to hanson44 For This Useful Post:
vkumbhakarna (04-19-2013)
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Get Pid from a command output hariprasad123 Shell Programming and Scripting 5 08-20-2010 01:59 AM
kill -3 <PID> ... where the output file goes? haroon_a AIX 3 12-01-2009 09:05 AM
determine pid from ps -ef | grep something new2ss UNIX for Dummies Questions & Answers 17 06-07-2009 06:22 PM
output nohup file containg the PID plsrn Shell Programming and Scripting 0 05-11-2009 03:39 AM
Output of ps + awk in a variable to get PID amio Shell Programming and Scripting 2 03-10-2009 12:59 PM

All times are GMT -4. The time now is 05:45 AM.