I need a script that can run on a Linux server that can do this:
Scan this folder /test/dates/
Within that folder there might be subfolders.
If subfolders are found they are in the format %year%-%month%-%day%-%hour%-%minute%-%second%
So for example this folder might exist there: /test/dates/2011-01-01-13-00-00
Meaning folder is date:
: year 2011
: month 01
: day 01
: hour 01
: minute 01
: second 01
there might exist one folder or none but mostly its alot of folders.
The folders date is always in the future - could be days / hours that differ but mostly the folders are a few minutes in the future.
Then the script should compare the current date with the folders date.
And if the folders date is not more than 10 minutes in the future it should run a bash file:
/test/[url removed, login to view]
If a folder exists that is less than 10 minutes in the future the script should not run.
I prefer if the script is in perl format.
I plan to schedule your script to run with a cron task / each hour.
Thanks for help,
This looks to be a very straightforward script. I can have it for you within a few hours of acceptance, and will work with you to test it and ensure it is working exactly as you expect. Thanks!