WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Create a log file  (Read 2552 times)

Offline malikawan

  • Full Member
  • ***
  • Posts: 243
Create a log file
« on: December 03, 2014, 04:09:13 PM »
If some one delete a folder or file using command line then we can see the log of command from .bash_history but if some one delete file or folder with mouse and keyboard then how i find these log. if there is no log file can we create a log that any one delete  a file or folder we have a log file for it

any idea plz

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Create a log file
« Reply #1 on: December 04, 2014, 04:50:58 AM »
Yes, you can monitor the entire filesystem for delete events with inotify. Note that such a big monitoring target may cost some performance.
The only barriers that can stop you are the ones you create yourself.

Offline malikawan

  • Full Member
  • ***
  • Posts: 243
Re: Create a log file
« Reply #2 on: December 04, 2014, 02:19:43 PM »
Sir Curaga thanks for your kind reply i am working on it but i am not success to log deleted files with inotify. because its too difficult to understand. Sir can you help me about that i just want to create a log file and  which save file name, date and time of the deleted files.
If you are not much busy then plz help

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Create a log file
« Reply #3 on: December 05, 2014, 04:46:20 AM »
It is not trivial code, requiring to fully recurse every directory.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: Create a log file
« Reply #4 on: December 05, 2014, 09:12:20 AM »
Hi malikawan
The repository contains  inotify-tools.tcz. Have you read:
http://linux.die.net/man/1/inotifywatch

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: Create a log file
« Reply #5 on: December 05, 2014, 09:18:58 AM »
Hi malikawan
Actually this is the one I think you need:
http://linux.die.net/man/1/inotifywait