(Elementary user)
My goal is to make a script that will:
1) Look for all files in a single directory that begin with plans*
2) Find the one with the most recent time stamp (in my example 18:48) and rename it to plans.pdf
3) Delete all the other files beginning with plan*
[root@sgi subtempl]# ls -al plans*
-rw-rw-rw- 1 root apache 1141692 Mar 3 18:45 plans-1.pdf
-rw-rw-rw- 1 root apache 1141692 Mar 3 18:48 plans-2.pdf
-rw-rw-rw- 1 root apache 1269504 Mar 3 18:44 plans.pdf
Is it possible to do this using a bash script that I could execute with the crontab?
Best regards
My goal is to make a script that will:
1) Look for all files in a single directory that begin with plans*
2) Find the one with the most recent time stamp (in my example 18:48) and rename it to plans.pdf
3) Delete all the other files beginning with plan*
[root@sgi subtempl]# ls -al plans*
-rw-rw-rw- 1 root apache 1141692 Mar 3 18:45 plans-1.pdf
-rw-rw-rw- 1 root apache 1141692 Mar 3 18:48 plans-2.pdf
-rw-rw-rw- 1 root apache 1269504 Mar 3 18:44 plans.pdf
Is it possible to do this using a bash script that I could execute with the crontab?
Best regards