I am trying to set a time IN SHELL SCRIPT so that it runs automatically during the working hours and stop for set times and rerun again after the set times. NOT run for set amount of time or period of time.. Time depends on how many things to process. Usually takes 3~5 hours.. but I want this program to pause at 12am to 3am and rerun again after that time..
for example.
if [ -d /tmp/test ]
then
for dir in $(ls -d $DIR1/* | grep test)
do
....
done
fi
how can I write this in Shell Script?
my point is to run a single shell script fully automated.. it runs only ONCE processing all the necessary work during this ONE run.. but at the given time it should PAUSE and rerun again.
how can I implement this inside of Shell Script?
some people recommended cron but isn't this only for execution command that does not go into the shell script? and isn't this also for just setting how long it should run?