What is the best way to run a bash script periodically on ubuntu?
There are several ways to run a bash script periodically on Ubuntu, but one of the most common methods is to use the cron utility. Here are the steps to set up a cron job:

1. Open a terminal window.

2. Enter the command crontab -e to edit your user's crontab file.

3. If prompted, select an editor to use with crontab.

4. In the crontab file, add a new line for the job you want to run. The format of a cron job line is as follows:
``` 
*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of the week (0 - 6) (Sunday is 0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of the month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)
``` 
For example, to run a bash script every day at 3 AM, the cron job line would look like this:
``` 
0 3 * * * /path/to/script.sh
``` 
5. Save and exit the crontab file.

Your bash script will now run automatically according to the schedule you specified in the cron job line. You can view your scheduled cron jobs by running the crontab -l command in the terminal.
Below is an instruction that describes a task. Write a response that appropriately completes the request.

### Instruction:

What is the best way to run a bash script periodically on ubuntu?

### Response:

There are several ways to run a bash script periodically on Ubuntu, but one of the most common methods is to use the cron utility. Here are the steps to set up a cron job:

1. Open a terminal window.

2. Enter the command crontab -e to edit your user's crontab file.

3. If prompted, select an editor to use with crontab.

4. In the crontab file, add a new line for the job you want to run. The format of a cron job line is as follows:
``` 
*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of the week (0 - 6) (Sunday is 0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of the month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)
``` 
For example, to run a bash script every day at 3 AM, the cron job line would look like this:
``` 
0 3 * * * /path/to/script.sh
``` 
5. Save and exit the crontab file.

Your bash script will now run automatically according to the schedule you specified in the cron job line. You can view your scheduled cron jobs by running the crontab -l command in the terminal.
