Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: How long have you been sitting on my server?

by tomhukins (Curate)
on Jan 27, 2003 at 18:50 UTC ( #230304=note: print w/replies, xml ) Need Help??


in reply to How long have you been sitting on my server?

Mr. Muskrat has already answered your question directly, but I hope I can provide some useful ideas:

If your users are technically knowledgeable, you might find they replace the older files with newer files to avoid your 30 day restriction. In this case, you might want to compare the contents of all files within each user's home directory with the contents of all files that were previously there.

You could use Digest::SHA1 or Digest::MD5 as a checksum for the contents of each file, perhaps stored in a DBM database or similar. File::Find::Rule::Digest might help.

  • Comment on Re: How long have you been sitting on my server?

Replies are listed 'Best First'.
Re: Re: How long have you been sitting on my server?
by Anonymous Monk on Jan 27, 2003 at 19:11 UTC
    Mr. Muskrat has already answered your question directly

    mtime and atime do not tell me how long the file has been on the server. ctime or the inode change time represents the time when the file's meta-information last changed. So ctime also doesn't tell me how long the file has been on the server.

    Just thinking off the top of my head here: Could I come up with a script that logs any uploaded file in a database or textfile? The script would have to record the file the instant it gets uploaded. How could I do this if we are using ftp to do the uploading? (This idea isn't perfect, since the user could always rename the file, but whatelse could i do? . . .)

      A simple yet sloppy fix would be to have your script create a .txt file, named the same as you upload file. Since it is created at time of upload have your script check the $mtime of the txt file and if it is 30 days old delete filename.* I like the hash answer much better, though.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://230304]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2021-01-18 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?