Use Crontab to Execute a Script only on Weekdays

Home Questions Use Crontab to Execute a Script only on Weekdays

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  admin 2 years, 1 month ago.

  • Author
    Posts
  • #6676 Reply

    admin
    Keymaster
    Offline
    Topics: 65
    Replies: 65

    How to schedule in crontab to run a command or shell script only on working days (Monday to Friday). I tried the below one, but its running even on weekends also.

    * * * * * command

    Expecting the answer as soon as possible. Advance Thanks bro.

  • #6772 Reply

    admin
    Keymaster
    Offline
    Topics: 65
    Replies: 65

    Try below command in crontab to run the command only on weekdays.

    * * * * 1-5 command

    1-5 indicates Monday to Friday

Reply To: Use Crontab to Execute a Script only on Weekdays

You can use BBCodes to format your content.
Your account can't use Advanced BBCodes, they will be stripped before saving.

Your information: