I need to create an cron job with the following functionality:
The job should go to a particular directory and touch one file every 5 seconds. It should run for only 1 minute. The logic is to change the timestamp of the file.
I've come up with the following logic:
I have created the below cron job:
00-01 09 * * * /home/flexsys/test.sh
(the job will start at 9:00 and run up till 9:01)
The script contents is as follows:
#!/bin/tcsh
cd /home/A/B/C/
while true
do
sleep 5
touch ABC.txt
done
I don't understand what to put in which condition tab. I have tried this through without the looping clause but it only touches the file once. I need to do it repeatedly until 9:01. What can I do to achieve this?