-
.Net
-
Backup
-
Data Storage Containers
-
Docker Containers
-
Environment Management
- Swap-Domains
- Clone Environment
- Create Environment
- Environment Aliases
- Environment Aliases
- Environment Migration between Regions
- Environment Regions
- Environment Transferring
- Environment Variable
- Environment Variables
- Environment Variables(Apache meaven, Memcached)
- Environment Variables(Go)
- Environment Variables(JAVA)
- Environment Variables(Load Balancer)
- Environment Variables(Node.js)
- Environment Variables(PHP)
- Environment Variables(Ruby)
- How to Migrate a WordPress Site to BitssCloud PaaS
- How to migrate my environments from another Jelastic provider?
- HTTP Headers
- Java VCS Deployment with Maven
- Setting Up Environment
- Share Environment
- Why is my environment in sleeping mode?
- Show all articles (9) Collapse Articles
-
Java
- Environment Variables - Java custom Environment Variables
- Java App server Configuration
- Java Options and Arguments
- Multiple Domains on Tomcat server
- Secure Java Encryption and Decryption
- Spring Boot Standalone and Clustered Java Applications with BitssCloud
- Timezone Data for Java/PHP App Server
- Tomcat HTTP to HTTPS redirect
- WildFly server
-
LiteSpeed Web Server
-
OOM Killer
-
Python
-
Reseller SetUp
-
Secure Socket Layer (SSL)
-
Troubleshooting
-
Account Management
-
CDN
-
Databases
- Database Configuration
- Database Connection Strings
- Database Hosting in BitssCloud
- Environment Variables(Database)
- Galera Cluster not working
- How to export/Import Database via Command line
- How to install MSSQL server on Linux (2017)
- MariaDB/MySQL Auto-Сlustering
- MongoDB Database Backups
- PostgreSQL Database Backups
- PostgreSQL Database Replication
- PostgreSQL Master-Slave Cluster
- Remote Access to PostgreSQL
- Schedule Backups for MySQL and MariaDB Databases
- Scheduling Databases Backups
-
Domain Name Management
- Container Redeploy
- Custom Domain Name
- DNS Hostnames for Direct Connection to Containers
- How to Bind Custom Domain via A Record
- How to Bind Custom Domain via CNAME
- Multiple Custom Domains on an Nginx Web Server
- Multiple Domains with Public IP
- Multiple Public IP Addresses for a Single Container
- Setup WordPress Multisite Network with Domain Mapping and CDN
-
Jenkins
-
Load Balancing
-
PHP
- Creating Environment for PHP
- Deploy PHP Project Via GIT SVN
- How to Check Change PHP Version in BitssCloud
- How to create environment for AngularJs/ReactJs
- How to Enable PHP Extensions
- How to Install Custom PHP Application
- Ion cube Loader
- MariaDB PHP connection
- MySQL PHP Connection
- NGINX PHP
- PHP App Server Configuration
- PHP Connection to MongoDB
- PHP security settings
- PHP Session Clustering
- PostgreSQL PHP Connection
- Running Multiple Domain Names on Apache Server
- Security configuration for Apache
- Zero Downtime (ZDT) Deployment for PHP
- Show all articles (3) Collapse Articles
-
Release Notes
-
Ruby
-
SSH
-
Wordpress
-
Application Management
-
Cluster
-
Deploying Projects
-
Elastic VPS
- CentOS VPS
- Elastic VPS configuratation
- Elastic VPS with full root access
- Installation of cPanel in BitssCloud
- Java Console Application with CentOS VPS
- Linux VPS Access via Public IP
- Linux VPS Access via SSH Gate
- Setting Mail Server Inside CentOS VPS
- Setting Mail Server Inside CentOS VPS
- SSH Access to VPS Gate
- Ubuntu VPS
- Ubuntu with CSF Firewall
-
High Availability
-
Jitsi
-
Node.js
-
Pricing System
-
Request Handling
-
Scaling
- Application Server with horizontal scaling
- Automatic Horizontal Scaling
- Automatic Horizontal Scaling: Multi Nodes
- Automatic Vertical Scaling
- Database Horizontal Scaling
- Docker Containers Horizontal Scaling
- Horizontal Scaling
- Load Balancer with horizontal scaling
- Memcached horizontal scaling
- Storage Container
- VPS Horizontal Scaling
-
Traffic Distributor
-
General
- Apache & NGINX Modules
- BitssCloud Dashboard Guide
- Build and Deploy Hooks
- Cron Job scheduler
- FFMPEG Setup
- File Synchronization
- FTP Overview
- FTP/FTPS Support in BitssCloud
- How to Deploy Magento into BitssCloud PHP Cloud
- How to Enable Expert Mode in JCA
- How to open a support ticket to BitssCloud
- Installation of FTP
- Kubernetes Cluster
- MarketPlace
- Reduce Cloud Waste with Automatically Scheduled Hibernation
- Run Configuration
- SFTP Protocols for Accessing BitssCloud Containers.
- Supported OS Distributions for Docker Containers
- Timezone Addon
- Two-Factor Authentication
- Types of Accounts
- Varnish
- Websockets Support
- What is Cloudlet
- What is PaaS & CaaS
- WordPress AddOn
- Zero Code Change Deploy with No Vendor Lock-In for Smooth Migration across Cloud Platforms
- Show all articles (12) Collapse Articles
-
Go lang
-
Wordpress category
-
Data Storage Container
-
Memcached
-
Account & Pricing
Cron Job scheduler
Setting Up Cronjob
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.
BitssCloud gives you the possibility to run your programs at a 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.:
- logs clearing
- backing up
- scripts running
Check out the example below.
Create the environment
- Log into the BitssCloud dashboard and click on Create environment button.
- 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.
Upload Script
Application Server
1. Click the Config button for your application server.
2. Upload scripts you want to run to the following folder:
- home – if you use a Java server in your environment (as we do in this instruction)
- the folder where your application is stored – if you use a PHP server in your environment
Database
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).
Cron Event Scheduler
- 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.
1 | {minute} {hour} {day} {month} {day-of-week} {command-line-to-execute} |
Field | Range of values |
---|---|
minute | 0-59 |
hour | 0-23 |
day | 1-31 |
month | 1-12 |
day-of-week | 0-7 (where both 0 and 7 mean Sun, 1 = Mon, 2 = Tue, etc.) |
command-line-to-execute | the path to the program you want to run |
While stating these values you need to follow the next standards:
- The fields have to be in that exact order, with no empty or missing fields.
- If needed you can use a wildcard character – “*” (the asterisk). In a crontab file it represents every possible value for the field. For example, specifying “*” in the “hour” field means “to run every hour”.
- The “/” character is used to specify additional frequency assignments. For example, “* / 3” in the “hour” means “every three hours”.
- For each individual parameter, you can specify multiple values separated by commas. For example, if in the “hour” you type “1,6,19”, the job will run “at 1:00, at 6:00, and 19 hours”. You can also specify the interval, for example, “8-17” would mean that the program will be run “every hour from 8 to 17 inclusive”.
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:
- home folder for Java compute nodes:
- /opt/tomcat/temp/{scriptName} – Tomcat, TomEE
- /opt/jetty/home/{scriptName} – Jetty
- /opt/glassfish3/temp/{scriptName} – GlassFish
- folder with your application files & scripts for PHP compute nodes:
- /var/www/webroot/{appFolder}/{scriptName}
- scripts folder for MySQL/MariaDB databases:
- /var/lib/jelastic/bin/{scriptName}
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 | */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 specifying the interpreter:
- /bin/bash – for Bash
- /usr/bin/python – for Python
- /usr/bin/perl – for Perl
- /bin/sed – for SED
- /bin/awk – for AWK
- /usr/bin/expect – for Expect
- /usr/bin/php – for php-interpreter
In this case, your command will be as follows:
1 | */1 * * * * /bin/bash /opt/tomcat/temp/test.sh |
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 BitssCloud. Enjoy!
Cronjob is a nifty tool to prevent problems from occurring and provide you with peace of mind. As you see, it is very easy to schedule your tasks with the BitssCloud new feature. Enjoy!