To run a script every 5 minutes using crontab, follow these steps:
Open the crontab editor by typing crontab -e
in the terminal.
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.
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.
Asked: 2021-07-31 11:00:00 +0000
Seen: 16 times
Last updated: Apr 09 '23