Find the answer to your Linux question:
Results 1 to 2 of 2
Hi Everybody, How to schedule a job using cron that shouldn't run between working hrs 9am-5pm, while run in non working hrs every hour, every day of the month, month ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    6

    Smile Help with cronjob scheduling

    Hi Everybody,

    How to schedule a job using cron that shouldn't run between working hrs 9am-5pm, while run in non working hrs every hour, every day of the month, month & week.

    I tried the following way, not sure I can use logical not operator(!). Please correct me if wrong or suggest other ways which might be better.

    crontab -e
    0 !9-17 * * * /path/to/script/file

    I guess other way is
    0 17-8 * * * /path/to/script/file

    Thank you in advance

  2. #2
    Just Joined!
    Join Date
    May 2008
    Location
    Bangalore, India
    Posts
    24
    Hi

    you can use the otherway, modify it to
    Code:
    0 17-23,0-8 * * * /path/to/script/file

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...