Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


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

Rep: Reputation: 15
Time and Date on files


I ve got a Samba server with a shared folder.

This folder is used to exchange files internally in the office,
and I need a 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, only that when I copy the file to the samba server,
the "created" and "modified" fields stay the same. So, if the script is in a cron.hourly, it deletes all files on the hour rather than after 48.

How do I work around this?

Thanks for any help

Old 09-05-2005, 04:18 AM   #2
Bruce Hill
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,934

Rep: Reputation: 128Reputation: 128
Not sure I understand. Are you using "cp <filename> <destination>" to
copy the files to the server? I don't use Samba, but I backup my comps
to my server with "rsync", and sometimes copy individual files with "cp".
Both have switches available that will allow you to retain permissions
when you copy, the simplest being "cp -a" if you've just copying one
file, and do it as root rather than user.

Sorry if I missed you're meaning. Both "man rsync" and "man cp" have
reasonable explanations of the switches you will need to use.
Old 09-05-2005, 04:32 AM   #3
Registered: Aug 2005
Location: Europe
Posts: 63

Original Poster
Rep: Reputation: 15
I m copying files from Windows workstations using samba.
Simply c&p into the shared folder.
Can anyone help?


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
Start Date + Time Duration = End Date/Time calculator? ToBe Linux - General 3 09-26-2005 10:17 AM
date and time osheasf Linux - Software 1 06-15-2005 07:47 AM
date/time in c++ 1337 Twinkie Programming 3 01-01-2005 12:23 AM
Display the date and time from another time zone lothario Linux - Software 4 07-31-2004 03:27 PM
Date and Time mairul Debian 7 12-25-2003 12:26 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:50 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