What is Cron job?
Cron is a utility in Linux, also known as a cron job, and is a time-based scheduler in Unix-like operating systems(Linux, Mac OS, etc.) as a pure definition. It simply allows you to schedule the execution of commands on your Linux system at specific intervals or on a schedule. You can create almost any kind of Schedule with the syntax.
1* * * * * /path/to/script.sh 2* * * * * command
Here, The first 5 asterisk signs allow you to control minutes, days, hours, months and days of weeks. The asterisk sign means “Every”. It means that the above-given command and script will run every minute, every hour, every day of the week, all the days in a month, and every month!
You can do
*/2 to change settings to “alternate”. Or you can set just a number anywhere, Like 1 or 2, to execute a command every 2nd day of a week, 2nd day of a month, 2nd month.
If it is too hard for you, ServerAvatar has a preset to set the schedule quickly. Finally, let's see how you can create cron jobs with ServerAvatar.
Create a Cronjob
Step 1: First, log in to the ServerAvatar Account.
Step 2: Click on the Server Dashboard button.
Step 3: You will see the option Cronjobs on the left-hand sidebar of the Server Panel. Click on “Cronjobs”.
After that, you will see the Cronjobs screen like the below image.
Step 4: Click on the Create button on the top right of the Cron jobs table, as mentioned in the above image. By clicking, a form will appear below in which you have to fill up the necessary details.
Fill out the required fields in the form-
Name: The Name for identification of your cron job.
Application User: Select an application user as whom you want to schedule the commands.
Command to Execute: Type command or script to execute.
Schedule: Here, you can select an execution time for your command ranging from every minute to every month, including a Custom schedule.
- Select a Custom Schedule type. And the fields have been extended as in the below image.
You can set any time interval you want.
Click on the Create Cronjob button, and your Server is ready to run the command at a precisely selected time.
Update a Cronjob
By clicking on the update icon as mentioned in the image below, you can Update your cron job.
Enable/Disable a Cronjob
By clicking on the toggle as mentioned in the image below, you can enable/disable your cron job.
Delete a Cronjob
By clicking on the Delete button as mentioned in the image below.
After that, an alert message will pop up on your screen to verify that you truly intended to perform this action.
Now, Click on the “Yes, I'm!” button to Delete the cronjob.