Use crontab to schedule and execute the jar Program

Source: Internet
Author: User


Use crontab to schedule the execution of jar program scheduling network exception NetworkException. jar Package 1. Set NetworkException. add the jar package to the/home/lingyh/Public directory. 2. Create NetworkException in the same directory. sh, enter the following content in the shell script :#! /Bin/bash cd/usr/local // usr/java/jdk1.6/bin/java-jar NetworkException. jar-cp/usr/java/jdk1.6/lib/tools. jar:/usr/java/jdk1.6/lib/dt. jar :. run/home/lingyh/Public/NetworkException. sh: Check whether the shell script can be executed. 3. Execute the cd/etc and crontab-e commands for editing. Enter the following content and execute the command every 10 minutes: # NetworkException. jar 0/10 ***/home/lingyh/Public/NetworkException. sh 4. Run/etc/init. d/crond restart crontab

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.