Koozali.org: home of the SME Server

Time and Date Stamp when file is deleted

Offline dilligaf

  • *
  • 266
  • +0/-0
    • http://www.willcraft.com
Time and Date Stamp when file is deleted
« on: November 05, 2004, 06:56:05 PM »
Using the Samba Recycle bin and it works great.
However a need has arisen to keep track of date and time a file was deleted.
The way I see the program works now, is it date time stamps the directory, but not the file.
Any possible ideas how to set this up so the deleted file reflects the date and time it was deleted.
Thanks

Offline Reinhold

  • *
  • 517
  • +0/-0
    • http://127.0.0.1
Time and Date Stamp when file is deleted
« Reply #1 on: November 05, 2004, 07:45:00 PM »
dilligaf,

?What contrib are you using there?

What I regard as the (Samba)/(SME) recyle bin standard works like this:
1) User deletes file in a samba share.

2) samba vfs module moves the file to the recycle bin defined in smb.conf as
 
Code: [Select]
vfs object = /usr/lib/samba/vfs/recycle.so
vfs options = /etc/e-smith/templates/etc/smb.conf/50recyclebin


3) samba find the rest of the procedure in smb.conf in the [recycle] part like :

Code: [Select]
[recycle]
# name of the recycle bin at root level of share
name = .recycle
# mode :
# KEEP_DIRECTORIES = retain directory hierarchy of deleted file,
#                    i.e. recreate all directories in recycle bin
# VERSIONS         = create copies in case of identical file names in recycle b$
# TOUCH            = touch access date of files moved into the recycle bin
mode = KEEP_DIRECTORIES|VERSIONS|TOUCH
# maximum file size to be moved to the recycle bin (0 means any size)
maxsize = 0
# exclude file names with the following extensions:
exclude = *.tmp|*.temp|*.o|*.obj|~$*
# exclude directories:
excludedir = /tmp|/temp|/cache
# Add file extensions of files where no versioning is wanted (i.e. copy # 1...)
# only valid when mode=VERSIONS is set
noversions = *.doc|*.xls|*.ppt

4) actually a crontab event then deletes the file (afair)

IN SUMMARY: Have a look at TOUCH ... it supposedly does what you want...


HTH - and don't forget to make changes/additions in (the) templates
(or all will be gone with reboot as you sure know .-)

Regards
Reinhold
............

Offline dilligaf

  • *
  • 266
  • +0/-0
    • http://www.willcraft.com
Time and Date Stamp when file is deleted
« Reply #2 on: November 06, 2004, 12:18:36 AM »
Thanks,
I understand what touch does.
And like I said it dates the folder, not the file.
So an example of the problem is let's say yesterday someone deleted a file, it moves it the the recycle bin, and date time stamps that folder, not the file.
Now today someone else deletes a file, it again changes the folder date, not the newly deleted file day.
In a nutshell it is the ability to identify when the file was deleted.
If over a period of time 10 files are deleted, you do not know when they were deleted, just the last one, as it is that one that changes the folder date.
Test it you will see what I mean.,
Dan