Multiple processes write to log file at the same time


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Multiple processes write to log file at the same time
# 1  
Old 09-27-2010
Multiple processes write to log file at the same time

If we have 3 process to write to same log file at the same time like below. will it cause the data outdated because the multiple process writing same time? It this a safe way to keep the log for multiple process?

p1 >> test.log &;
p2 >> test.log &;
p3 >> test.log &


Thanks,
# 2  
Old 09-27-2010
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Proceed here:

https://www.unix.com/shell-programmin...#post302456944

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

File write begin/end, recording time

Hello all, How can I find out the start and end of the writing file in the directory or recording time for writing file? I have a directory where small ~ 1*MB temporary files are written. After the end of the record, they are retrieved and erased. I can only find out that the files are... (4 Replies)
Discussion started by: mrAibo
4 Replies

2. Shell Programming and Scripting

Multi threading - running multiple processes at the same time

so i've been using this a lot in a lot of my scripts: ( columnA & columnAPID=$! & columnB & columnBPID=$! & columnC & columnCPID=$! &) & wait ${columnAPID} wait ${columnBPID} wait ${columnCPID} It seems to work as ive seen it dramatically reduce run time of my scripts. however, i'm... (5 Replies)
Discussion started by: SkySmart
5 Replies

3. Shell Programming and Scripting

Batch write multiple usb in same time

Hi there, I would write a bash script to format then create a range of folder (folder name is number) to a usb stick. for numbers in $(seq -w 001 999) do pause "Press any key to start" mkfs.vfat -F32 /dev/sdc1 mount /dev/sdc1 /media/usb mkdir /media/$numbers umount /dev/sdc1... (8 Replies)
Discussion started by: wayneliao38
8 Replies

4. Shell Programming and Scripting

Multiple process write to same log file at the same time

If we have 3 process to write to same log file at the same time like below. will it cause the data outdated because the multiple process writing same time? It this a safe way to keep the log for multiple process? p1 >> test.log &; p2 >> test.log &; p3 >> test.log & Thanks, (5 Replies)
Discussion started by: casttree
5 Replies

5. Programming

File access from multiple processes or threads?

Hi, Can anyone give me any idea when multiple processes access a file (like opening it, modifying it etc.) how can the synchronization can be done if they can access the same file at any time? How can this scenario is different from when multiple threads access a same file, modifying it etc- in... (7 Replies)
Discussion started by: sanzee
7 Replies

6. UNIX for Dummies Questions & Answers

Script to Extract time from log files and write to a excel

Can someone help me with writing a unix script for following requirement 1) I have a log file in which we have start time and end time (format: hh:mm:ss) Example: starting script on Thu Jun 5 20:50:52 --------- Thu Jun 5 21:55:33 - Script Completed 2) I want to extract... (4 Replies)
Discussion started by: santosham
4 Replies

7. Shell Programming and Scripting

Script to Extract time from log files and write to a excel

Can someone help me with writing a unix script for following requirement 1) I have a log file in which we have start time and end time (format: hh:mm:ss) Example: starting script on Thu Jun 5 20:50:52 Thu Jun 5 21:55:33 - Script Completed 2) I want to extract start time and end time of... (0 Replies)
Discussion started by: santosham
0 Replies

8. UNIX for Advanced & Expert Users

Script to Extract time from log files and write to a excel

Can someone help me with writing a unix script for following requirement 1) I have a log file in which we have start time and end time (format: hh:mm:ss) Example: starting script on Thu Jun 5 20:50:52 Thu Jun 5 21:55:33 - Script Completed 2) I want to extract start time and end time of... (0 Replies)
Discussion started by: santosham
0 Replies

9. Shell Programming and Scripting

Multiple processes writing on the same file simultaneously

Hi All, I have encountered a problem,please help me. I have a script in which multiple processes are writing on to the same file . How should I stop this , I mean lock mechanism can be implemented or we can write the at different files and then concatenate the files. What would be a better... (1 Reply)
Discussion started by: Sayantan
1 Replies

10. UNIX for Advanced & Expert Users

How to log start/stop time of ALL processes

Hi all, I joined this forum today and this is my first question. I thank you all for viewing it. I will try to be brief. The OS: HP-UX B.11.11 U 9000/800 There are lot of cron scheduled perl scripts running on this server, which do different things at different time. Some of them process... (10 Replies)
Discussion started by: bluesky099
10 Replies
Login or Register to Ask a Question