Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.