LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-29-2009, 11:26 AM   #1
ShahidKhan
LQ Newbie
 
Registered: Oct 2009
Posts: 1

Rep: Reputation: Disabled
Filesystem files getting deleted


Context:

We found one of environments that the files are getting deleted from /opt/ac60 directories. The files getting deleted seemed to be random. Sometime whole folders were deleted and sometimes it was few files in the folder.

What logging do we have enabled:
We enabled the audit rpm enabled on the servers.
audit-1.0.16-3.el4
audit-libs-1.0.16-3.el4
audit-libs-devel-1.0.16-3.el4
We started the Auditd services (service auditd start) and added the watch.

What logs do we have:
We did manage to get a few unlink and rmdir commands in the audit logs. Sample below:
type=PATH msg=audit(10/29/2009 09:30:44.295:63734) : name=/data/opt-linux-user/ac60/ac.ini.13_03_2008 flags=parent inode=16826370 dev=08:31 mode=dir,755 ouid=linux-user ogid=usergroup rdev=00:00
type=CWD msg=audit(10/29/2009 09:30:44.295:63734) : cwd=/home/linux-user
type=FS_INODE msg=audit(10/29/2009 09:30:44.295:63734) : inode=16826370 inode_uid=linux-user inode_gid=usergroup inode_dev=08:31 inode_rdev=00:00
type=FS_WATCH msg=audit(10/29/2009 09:30:44.295:63734) : watch_inode=16826370 watch=ac60 filterkey=cma_dir perm=read,write,append perm_mask=write,exec
type=SYSCALL msg=audit(10/29/2009 09:30:44.295:63734) : arch=i386 syscall=unlink success=yes exit=0 a0=8f05f18 a1=e28ef8 a2=e2a15c a3=8f05f18 items=1 pid=31813 auid=linux-user uid=linux-user gid=usergroup euid=linux-user suid=linux-user fsuid=linux-user egid=usergroup sgid=usergroup fsgid=usergroup comm=sftp-server exe=/usr/libexec/openssh/sftp-server
type=PATH msg=audit(10/29/2009 09:31:12.740:63751) : name=/data/opt-linux-user/ac60/audittrail flags=parent inode=16826370 dev=08:31 mode=dir,755 ouid=linux-user ogid=usergroup rdev=00:00
type=CWD msg=audit(10/29/2009 09:31:12.740:63751) : cwd=/home/linux-user
type=FS_INODE msg=audit(10/29/2009 09:31:12.740:63751) : inode=16826370 inode_uid=linux-user inode_gid=usergroup inode_dev=08:31 inode_rdev=00:00
type=FS_WATCH msg=audit(10/29/2009 09:31:12.740:63751) : watch_inode=16826370 watch=ac60 filterkey=cma_dir perm=read,write,append perm_mask=write,exec
type=SYSCALL msg=audit(10/29/2009 09:31:12.740:63751) : arch=i386 syscall=rmdir success=yes exit=0 a0=8f05f10 a1=e28ec7 a2=e2a15c a3=8f05f10 items=1 pid=31813 auid=linux-user uid=linux-user gid=usergroup euid=linux-user suid=linux-user fsuid=linux-user egid=usergroup sgid=usergroup fsgid=usergroup comm=sftp-server exe=/usr/libexec/openssh/sftp-server


Any help would be appreciated.
 
Old 10-29-2009, 11:51 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,651

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by ShahidKhan View Post
Context:

We found one of environments that the files are getting deleted from /opt/ac60 directories. The files getting deleted seemed to be random. Sometime whole folders were deleted and sometimes it was few files in the folder.

What logging do we have enabled:
We enabled the audit rpm enabled on the servers.
audit-1.0.16-3.el4
audit-libs-1.0.16-3.el4
audit-libs-devel-1.0.16-3.el4
We started the Auditd services (service auditd start) and added the watch.

What logs do we have:
We did manage to get a few unlink and rmdir commands in the audit logs. Sample below:

Any help would be appreciated.
Well, since you've got user group, time the command was performed, you can look at the output of "last", to see who was logged in during the event. From there, you can look at their shell-history file, to see if they did anything (note: if they're logged in while you're looking, get them to log out, so the shell history will be written and up-to-date). Also, check the cron jobs, since something may be monitoring that directory, and doing a file purge, based on date/time stamps on the files.
 
Old 11-06-2009, 12:36 AM   #3
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466
Blog Entries: 6

Rep: Reputation: 51
Can any filesystem monitoring tool be helpful under this scenerio?
 
Old 11-06-2009, 08:19 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,651

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by your_shadow03 View Post
Can any filesystem monitoring tool be helpful under this scenerio?
Not unless you write some custom code to take a 'snapshot' of the files/directories in question, write them to a log file, and use something like logwatch to see when it changes.
 
Old 11-07-2009, 01:08 AM   #5
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466
Blog Entries: 6

Rep: Reputation: 51
I am poor in writing script?
Anyone who can help me with this script/any tool?
 
Old 11-07-2009, 09:27 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,651

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by your_shadow03 View Post
I am poor in writing script?
Anyone who can help me with this script/any tool?
As we tell everyone...we can HELP you, but aren't going to write it FOR you. There are lots of bash tutorials available through Google, that can help get you started.

After you get something going, come back and post what you've written, and where you're getting stuck.
 
Old 11-07-2009, 09:57 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by your_shadow03 View Post
I am poor in writing script?
Anyone who can help me with this script/any tool?
Better to start your own thread.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recover deleted files from ext3 filesystem digdogger Linux - Software 15 07-16-2016 08:11 AM
Deleted files on a SMB-share - Files gone, space still allocated - Fedora 10 Zwentendorf Linux - Server 4 03-01-2009 05:04 AM
Mepis, copy files to thumb drive, files deleted? vremenno Linux - Newbie 6 09-15-2006 11:21 PM
How to recover a deleted file from ext3 filesystem ? Honor Linux - Software 1 12-21-2005 12:36 PM
Frontend for recovering deleted files from ext3 filesystem jayakrishnan Linux - General 3 12-16-2004 02:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:32 PM.

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