I'm running a script on synology (NAS) that is deleting files older than x days on certain folders.
The problem is that I want these files to be deleted after X days of being uploaded on the folder.
So I thought of using ctime, mtime, or atime, but the problem is that these are based on file change time, file modify time or file accessed time. Accessed time doesn't work for me, and modify time doesn't work because the files that I am uploading on Synology "import" the modify file time from Windows (sometimes very old times).
Does anyone know a solution?
touch
the files while uploading, or save them in directories named after the date?for F in *; do stat -c %z\ %n $F ; done | sort -r