Help - Search - Members - Calendar
Full Version: Cron Help Needed
Linuxhelp > In The Community > General Discussion
neiljmac
Hi. I hope someone can help.

I need to write a crontab entry which runs a script every day (at for example 17h30) but does not run on Saturday and Sunday.

The bit I am having the problem with is the exclusion of specific days.

Is it possible please?

Many thanks in advance,

Neil.
michaelk
Yes, have you read the man pages for crontab:
http://www.hmug.org/man/5/crontab.php

Here is a hint:
Only specify the days you want.
Lists are allowed. A list is a set of numbers (or ranges) separated by
commas. Examples: ``1,2,5,9'', ``0-4,8-12''.

So Mon = 1 and Fri = 5.
neiljmac
Hi.

Thank you very much for the quick reply and the information.
I have now read that man page you pointed out

Just to confirm I would be correct in assuming therefore, that this entry:
CODE
30 17 * * 1-5 /home/uk2mbcom/cronjobs/mbrm.sh

will run my mbrm.sh script at 17h30 every monday to friday?

Best regards,

Neil.
michaelk
Correct
neiljmac
Marvellous!

Thanks very much.

N.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.