How to run cron job every minute on Linux/Unix

To run a cron job every minute on a Linux/Unix system, you need to create a cron job that runs a shell script or command at the desired interval. Here’s how you can do this:

  1. Open the crontab file for editing:
crontab -e
  1. Add the following line to the end of the file:
* * * * * /path/to/command

Replace “/path/to/command” with the path to the shell script or command that you want to run.

This line tells cron to run the specified command every minute of every hour of every day of every month.

  1. Save and close the file.

The cron job is now set up and will run every minute.

Note: The crontab file is used to configure cron jobs for the current user. If you want to run a cron job as a different user, you will need to use that user’s crontab file.

Leave a Comment