i was trying out a shell script which has to remove a file for every 90 mins. this is the code i came up with .
$ crontab -e file1
file1 contains
30 1 * * * * rm -r /folder1/folder2/somefile.txt
Now i need the cron to run for every 90 mins. the problem with this is since the first field only accepts 0-59 i assumed it will add up the 30min and 1 hr as 90 mins, which i now think is incorrect. any suggestions ?
yeah- that will run at 01:30 every day, not every 90 mins.
you could try running it every 30 mins, and set a flag file - test the age of the file, and if greater than, say 70 mins, run your command and retouch your flag file...
Or set a counter,
Or simply set a sleep timer in there, after which time it re-runs itself...
Or get your script to calculate next run time and reschedule using at
the [your cmd] is identical in the two entries. Also it is general MUCH better to specify
a shell script to run rather than a command. You simply edit the shell script as the complexity of the requirement morphs. read: users complain
Without doing some research, and assuming that the SCO I'm familiar with might work differently, I would suspect that the 90 minute sequence of executing might be determined by the time of the last reboot.