LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 15
Time and Date on files


Heya,

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

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

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, 05:32 AM   #3
Azhrarn
Member
 
Registered: Aug 2005
Location: Europe
Posts: 63

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


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:01 PM.

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