LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   VSFTPD and file timestamps (https://www.linuxquestions.org/questions/linux-newbie-8/vsftpd-and-file-timestamps-136811/)

t3___ 01-20-2004 03:30 PM

VSFTPD and file timestamps
 
here is my dilemma...

I would like to have VSFTPD changed the timestamp on files that are uploaded to our FTP server so that I can script the files to automatically be deleted after 48 hours (FTP server will be for quick get/put operations, not long term storage). Unfortunately, when files are uploaded, they are maintaining their original creation/modified date. Any way to do this with a switch in VSFTPD, or a script on the FTP folder?

any help would be greatly appreciated - my searches have been fruitless..

Tom

Looking_Lost 01-20-2004 07:12 PM

I don't know about using vsftpd directly but I guess you could uses touch to modify the timestamp of each file, keeping a note of the current directories contents and periodically "touching" new files as they come in and every two days using find to pick out files that have been modified in the directory >= 2 days ago. Just a thought.

t3___ 01-21-2004 01:22 AM

Thanks much for the reply.

seems good enuf... the solution doesnt have to be absolutely perfect or fancy...

any other ideas anyone?

t3___ 01-21-2004 12:58 PM

with regard to using the TOUCH utility...

***how would I instruct TOUCH to only modify files that it had not "touched" previously?*** I think it may be the switch "-c", but the man pages indicated that this will skip files that TOUCH previously created... not modified...

here is the plan I came up with (using cron):

-every day at 11:58 pm, cron TOUCH to datestamp any files it has not previously modified with the current date and time.

-every day at 11:59 pm, cron the command "find <startdir> -ctime 48 -exec rm -f {} \" to delete files older than 48 hours.

any help would be greatly appreciated!

Tom

Looking_Lost 01-21-2004 02:26 PM

I guess you could have a file containg a directory listing taken at time A and compare it against a file containing the current directory listing taken at time B and use directly/send the output to another file which should contain the differences. If and buts start coming in though to complicate matters such as can the users delete the file themselves inbetween runs? The principle is there though to work around though and maybe some one will jump in with a one line does it all answer :)

comm -3 timeA timeB > differencesInListings


All times are GMT -5. The time now is 06:53 PM.