script to remove files older than // modification time
Hi,
a public share (samba, OpenMediaVault) is used for temporary file sharing. My intention is to keep this share clearly arranged and remove all files older than 30 days. Therefore daily script is running: Code:
find '/mountpoint/' -mtime +29 -type f -delete Any ideas how I can fix this issue? Is there an option that samba always sets a new modtime while copying or does another solution exists? thx |
Well, how do you do the files copies on your temporary file sharing ?
|
You can use "ctime" rather than "mtime". That will tell the last time anything in the inode changed (other than the automatic "atime" update due to the file being read).
Having a copied file retain the mtime of the original is standard DOS/Windows behavior. |
hm ok, thx!
Indeed ctime seems to do the job. Usually the copy process is from Windows-Hosts. |
All times are GMT -5. The time now is 07:52 PM. |