LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-05-2005, 04:46 AM   #1
Azhrarn
Member
 
Registered: Aug 2005
Location: Europe
Posts: 63

Rep: Reputation: 15
Samba - Modify File Date


Heya,

I ve got a Samba server with a shared folder.

This folder is used to exchange files internally in the office which uses Windows Workstations (just c&p into the Samba server) and I need any file copied onto it to be deleted automatically after 48 hours.

I ve been using a script in cron.hourly:

find "/raid/File Exchange" -mtime +2 -type f -exec rm -rf {} \;

which would work fine if the "modified" or "created" date were updated when the file is copied to the server. but it is not, making the script useless, as it deletes all files on the hour rather than after 48 (based on the old modified date which is usually more than 2 days before).

How do I work around this?

Thanks for any help

Paul
 
Old 09-06-2005, 01:51 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
You could keep a list of the files that were there the last time the script was run and touch any that didn't exist the last time the script was run.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to modify a file? kornerr Programming 4 08-08-2005 09:08 AM
Modify default date parameter in Search J.W. LQ Suggestions & Feedback 2 11-08-2004 12:03 PM
can't create/modify files in a samba share deadslota Linux - Newbie 4 08-07-2004 10:26 PM
modify file access & modify timestamps i2itstud Linux - General 1 05-20-2003 03:34 AM
samba modify file error lowly_tech Linux - Networking 4 05-17-2002 05:46 PM


All times are GMT -5. The time now is 03:17 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration