Cron is the time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes, such as connecting to the Internet and downloading emails.
CirrusGrid gives you a possibility to run your programs at specified time with a help of cron, which receives your instructions and performs any tasks following the derived scenarios. You can use this opportunity to perform periodic tasks, e.g.:
Check out the example below.
1. Log into the CirrusGrid dashboard.
2. Click Create environment.
3. In the Environment topology window choose the application server and database you want to use (for example, Tomcat and MySQL). Type the name of the environment and click Create.
In a minute your environment with both Tomcat and MySQL nodes will be created.
1. Click the Config button for your application server.
2. Upload scripts you want to run to the following folder:
1. Click the Config button for your database (MySQL or MariaDB).
2. Upload the scripts you want to perform to the scripts folder.
Note: Script you want to perform should be an executable file. If it isn’t, you can use built-in interpreters, such as Bash, Perl, Python, SED, AWK, or Expect (depending on the script you use).
1. In the already opened configurations tab navigate to the cron folder and open the {nodeName} file.
2. Here you can write all necessary commands to schedule your tasks. They should be composed in a way so that crontab will understand them. The basic format of a crontab schedule consists of 6 fields separated by spaces.
{minute} {hour} {day} {month} {day-of-week} {command-line-to-execute}
While stating these values you need to follow the next standards:
Pay attention that you should specify a full path to your script in the cron command. Depending on the location of your script the path can be as one of the following:
3. For example, if your script is located in the home folder of Tomcat and you want it to be performed every minute, your command line can look like this example:
*/1 * * * * /opt/tomcat/temp/test.sh
Tip: If your script does not have executable flag and you use built-in interpreters, such as Bash, Perl, Python, SED, AWK or Expect (depending on your script), you should add the following paths after time settings for explicit specifing the interpreter:
4. Please make sure there is a blank line after the last cronjob entry.
5. Save the changes in order to apply the settings.
That’s all. As you can see, it is pretty easy to schedule your tasks with CirrusGrid. Enjoy!
Powered by BetterDocs
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.