LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-13-2009, 01:56 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
File log


I would like to ask how can I do that -

In my REEL system , there are some files write to the path /tmp , then there is other script will move / delete the files in it , so I am unable to know what file have write to it , can advise if I would like to log what files have ever write to it , what can i do ?

I tried to write a script ( run by cron ) to list the file to a log file , but as there are so many files write to it and the files may be remove right when created , so this method seems not work , so I would like to ask any method can log the file precisely ? thx
 
Old 07-13-2009, 11:12 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ust View Post
I would like to ask how can I do that -

In my REEL system , there are some files write to the path /tmp , then there is other script will move / delete the files in it , so I am unable to know what file have write to it , can advise if I would like to log what files have ever write to it , what can i do ?

I tried to write a script ( run by cron ) to list the file to a log file , but as there are so many files write to it and the files may be remove right when created , so this method seems not work , so I would like to ask any method can log the file precisely ? thx
Please write clearly, your question is almost impossible to understand.

When you say there are some files in /tmp, what kind of files? Written by what program(s)?? And the "other script"...who wrote it? What does it do? You're not providing alot of information to work with. If I had to guess, I'd say to modify the "other script" that moves the files, to add something to snapshot what it's doing, if that's what you need.

And since you're using RedHat Enterprise...you can always call them for support, since you're paying for it.
 
Old 07-13-2009, 08:26 PM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by TB0ne View Post
Please write clearly, your question is almost impossible to understand.

When you say there are some files in /tmp, what kind of files? Written by what program(s)?? And the "other script"...who wrote it? What does it do? You're not providing alot of information to work with. If I had to guess, I'd say to modify the "other script" that moves the files, to add something to snapshot what it's doing, if that's what you need.

And since you're using RedHat Enterprise...you can always call them for support, since you're paying for it.

When you say there are some files in /tmp, what kind of files? Written by what program(s)?? And the "other script"...who wrote it? What does it do? You're not providing alot of information to work with. If I had to guess, I'd say to modify the "other script" that moves the files, to add something to snapshot what it's doing, if that's what you need.

And since you're using RedHat Enterprise...you can always call them for support, since you're paying for it.[/QUOTE]


When you say there are some files in /tmp, what kind of files? -- > text file
Written by what program(s)?? And the "other script"...who wrote it? --> these script is written by other administrator / programmer
What does it do? --> some script is used to housekeeping to remove unused file in /tmp

I'd say to modify the "other script" that moves the files --> as these script have different function , I do not want to modify it .

Actually , I just want to log down the file name that in /tmp , but the file will be removed from other script from time to time , so I would like to ask is there any method to log down the file name in /tmp ( before it is removed ) ? thx
 
Old 07-13-2009, 09:03 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
ust: Please edit your last post. You don't need to quote TBOne twice.
---

For workstations, it is common to have /tmp emptied out when booting up or powering down. Distro's often have a setting to do this for you automatically.

Servers which run continuously may have a cron job which deletes files of a certain age or older, files owned by a user who is no longer logged in, stale PID files for services or programs that aren't running, etc.

If a program has a file open, the lsof command can tell you the user and PID of the program using it. The easiest way of logging files that are deleted or moved by the script is to have the script do it.

Also, please explain why you want to do this? Files in /tmp are temporary files. Files in /tmp that aren't being used are not important.

Last edited by jschiwal; 07-13-2009 at 09:05 PM.
 
  


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
After log roll, Postfix cannot write to log file, Ubuntu 8.04 mboudro Linux - Server 6 09-17-2010 03:10 AM
setting file permissions for file /var/log/Xorg.0.log mfb Linux - Security 1 07-07-2009 01:41 PM
Firewall log file, how to make several different log files with IPTables? newtovanilla Linux - Newbie 5 11-28-2008 12:39 PM
any ideas to reduce log file size or make log file size managed? George2 Programming 2 08-13-2006 06:55 AM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 08:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:02 AM.

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