Linux: schedule a service to run in a time period

2

1

i want a service to be start at 8:00 and be ended in 14:00 automatically

i already do this manualy by:

/etc/init.d/myservice.sh start


/etc/init.d/myservice.sh stop

i think it should be related to cron jobs. any idea?

Alexar

Posted 2010-03-02T20:11:47.513

Reputation: 389

Answers

7

minutes | hour | day | month | day of week | username | command
0         8      *     *       *             myuser    /etc/init.d/myservice.sh start
0         14     *     *       *             myuser    /etc/init.d/myservice.sh stop

Replace myuser with whatever is appropriate. (probably root)

Also, belongs on serverfault or superuser

Earlz

Posted 2010-03-02T20:11:47.513

Reputation: 3 966