It has been awhile since I have had to drive into shell scripting. However, I have a shell script where I'm renaming files based on the file extension from a ftp upload.
Currently, the files are uploaded to the server via an FTP process. All files are renamed from filename.txt to filename.dat. What I would like to do is only rename the files based on the file's modified date after a certain number of minutes.
i.e. all files whose modified time is greater than five (5) minutes.
-mtime -5.
Below is my shell script:
#!/bin/bash
for name in /u/easy/ep2/data/download/*.txt; do
newname=${name%.txt}.log
mv "$name" "$newname"
done