Ask Your Question
3

How can I get my script to run successfully every 5 minutes using crontab?

asked 2021-07-31 11:00:00 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-04-09 10:00:00 +0000

woof gravatar image

To run a script every 5 minutes using crontab, follow these steps:

  1. Open the crontab editor by typing crontab -e in the terminal.

  2. Add a new line to the crontab file that specifies the timing of the script. To run the script every 5 minutes, use the following syntax:

    */5 * * * * /path/to/your/script.sh

    This line specifies that the script should be run every 5 minutes on any day of the week, any day of the month, and any month of the year.

  3. Save and exit the crontab editor.

Note: Make sure that your script has executable permission. You can set it by running chmod +x /path/to/your/script.sh in the terminal.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-07-31 11:00:00 +0000

Seen: 16 times

Last updated: Apr 09 '23