Skip to main content

Cronjobs

What is Cron job?

Cron is a utility in Linux, also known as a cron job, is a time-based scheduler in Unix-like operating systems(Linux, Mac OS, etc.) as a pure definition. It simply allows you to schedule 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 any of the 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.

step

If it is too hard for you, ServerAvatar has presets to quickly set the schedule. Finally, Let’s see how you can create cronjobs with ServerAvatar.

Create a Cronjob

Step 1: First, you need to log in to the ServerAvatar account.

Step 2: Click on the Server Dashboard button.

step 2

Step 3: Now, you will see the option Cronjobs on the left-hand sidebar of the Server Panel. Click on “Cronjobs”.

step 3

After that, you will see the Cronjobs screen like the below image.

step 3.1

Step 4: Click on the Create button located on the top right of the Cronjobs table, as mentioned in the above image. By clicking, a below form will appear in which you have to fill up the necessary details.

step 4

fill out the required fields in the form-

  1. Name: The name for identification of your cron job.

  2. Application User: Select an application user as whom you want to schedule the commands.

  3. Command to Execute: Type a command or script to execute.

  4. Schedule: Here, you can select an execution time for your command range from every minute to every month, including a Custom schedule.

    1. Select a Custom Schedule type. and the fields have been extended as in the below image.

step 5

You can set any time interval you want.

Click on the Create Cronjob button, and your server is now ready to run the command at a precisely selected time.

Update a Cronjob

By clicking on the update icon as mentioned in the below image, you can Update your cronjob.

step 2

Enable/DIsable a Cronjob

By clicking on the Toggle as mentioned in the below image, you can Enable/Disable your cronjob.

step 2

Delete a Cronjob

By clicking on the Delete button as mentioned in the below image.

step 2

After that, the alert message will pop up on your screen to verify that users truly intended to perform this action.

step 2

Now, Click on “Yes, Delete it!” button to Delete your cronjob.