# Setting Cron Job

**Now you need to create cron job on your server.**

**For cpanel and shared hosting**

**Go to cpanel dashboard and find advanced and open cron job tab**

![](https://1140342176-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MSR8RFkfNeWvT8M4lL9%2F-MSXYUty-hyEb-SQpZzi%2F-MSXZJNauNf5_m2t9t-3%2Fcommon.png?alt=media\&token=ea154d30-43c3-4e36-a144-ed59a12756d2)

**After opening cron job you will see similar settings. For more information check below screenshot. Run the command**

```
php /path/to/set_top_detail
```

![](https://1140342176-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MSR8RFkfNeWvT8M4lL9%2F-MSXZ_44RqvX-oa6cJvI%2F-MSXZhqRvdCpR8UR1IGG%2Ffind-cron.jpg?alt=media\&token=d8094a5d-8ce0-410c-8a88-0352efcbfeea)

## **For ubuntu servers**

**To start the Laravel Scheduler itself, we only need to add one Cron job which executes every minute. Go to your terminal, ssh into your server, cd into your project and run this command.**

```
sudo crontab -e
```

&#x20;This will open the server Cron tab file, paste the code below into the file, save and then exit. Make sure your **replace path-to-your-project with your project directory ex. var/www/html/projectdirectory**

```
/usr/bin/php /var/www/project/set_top_detail
```

&#x20;**For Check Cron Job is running or not after setup your cron job reload your site homepage and go to your project directory and open storage/logs and open file laravel.log.  Check if Ubuntu cron working fine or by hitting this command**\
**In Ubuntu, the cron service should start automatically. You can check it with these commands:**

```
sudo service cron status # checks if cron is running
						sudo service cron start  # starts it
						sudo service cron stop   # stops it
```
