[SLE] Track/trace an application's file access
How can I track/trace which files an application accesses while running? Only that application, and no others.. -- Anders Norrbring Norrbring Consulting -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Mon, 2006-06-19 at 15:18 +0200, Anders Norrbring wrote:
How can I track/trace which files an application accesses while running? Only that application, and no others..
strace -e trace=open -o my_progam.log my_program or even strace -e trace=open,access my_program You can also follow forked programs, add time stamps, dumping of function parameters, and more. See the man page. -- Roger Oberholtzer OPQ Systems AB Ramböll Sverige AB Kapellgränd 7 P.O. Box 4205 SE-102 65 Stockholm, Sweden Tel: Int +46 8-615 60 20 Fax: Int +46 8-31 42 23 -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Mon, 2006-06-19 at 15:51 +0200, Roger Oberholtzer wrote:
On Mon, 2006-06-19 at 15:18 +0200, Anders Norrbring wrote:
How can I track/trace which files an application accesses while running? Only that application, and no others..
strace -e trace=open -o my_progam.log my_program
or even strace -e trace=open,access my_program
You can also use 'lsof'. Rudolf -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
rudolf skrev:
On Mon, 2006-06-19 at 15:51 +0200, Roger Oberholtzer wrote:
On Mon, 2006-06-19 at 15:18 +0200, Anders Norrbring wrote:
How can I track/trace which files an application accesses while running? Only that application, and no others.. strace -e trace=open -o my_progam.log my_program
or even strace -e trace=open,access my_program
You can also use 'lsof'.
Both ways works fine for my needs.. :) Thanks guys! Anders. -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Tue, 2006-06-20 at 09:22 +0200, Anders Norrbring wrote:
rudolf skrev:
On Mon, 2006-06-19 at 15:51 +0200, Roger Oberholtzer wrote:
On Mon, 2006-06-19 at 15:18 +0200, Anders Norrbring wrote:
How can I track/trace which files an application accesses while running? Only that application, and no others.. strace -e trace=open -o my_progam.log my_program
or even strace -e trace=open,access my_program
You can also use 'lsof'.
Except lsof only lists currently open files. Not files that have been opened but may heve been closed by the time lsof is run. Depends on what you want to know. -- Roger Oberholtzer OPQ Systems AB Ramböll Sverige AB Kapellgränd 7 P.O. Box 4205 SE-102 65 Stockholm, Sweden Tel: Int +46 8-615 60 20 Fax: Int +46 8-31 42 23 -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
participants (3)
-
Anders Norrbring
-
Roger Oberholtzer
-
rudolf