Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


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

Rep: Reputation: 15
Samba - Modify File Date


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

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

Rep: Reputation: 66
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.


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 > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration