Here's the context :
on a samba server, I have some folders (that we'll call A,B,C,D ) which are supposed to receive files from a network scanner. The scanner renders a PDF file named like this :
(Year, Month, Day, Hour, minute, seconds)
I need those PDFs to be renamed the moment they appear in the folder, or within the minute (I'm thinking about crontab).
the renaming must be Something like
I've seen that "date +%F" does what I want for the timestamp, and I just have to manually set my prefix in the script.
I have the algorithm in mind, it must be Something like
"-read file.pdf -if the name of the file doesn't have [prefix] -then mv file.pdf [prefix]_[date].pdf -else nevermind about that file."
It's really hard for me to find the correct syntax for this.
I would prefer to retrieve the system timestamp of file creation and rename the file with it instead of using the filename generated by the scanner.