Timing monitoring in Linux environment with small white writing

Source: Internet
Author: User

I have been doing Java for many years, but for the Linux environment is basically small white one, before doing a Java timing processing, but it seems to be 10 days will hang off.

But Java also has no logs. So it's not clear how to investigate. So I want to write a timer monitoring program, if you monitor the Java program hangs, then start the Java program again.

A time-lapse monitoring code was added to the Linux crontab.

The following code is added to the file Etc/crontab:

#/etc/crontab:system-wide Crontab
# Unlike any and crontab you don ' t has to run the ' crontab '
# command to install the new version when you edit this file
# and Files in/etc/cron.d. These files also has username fields,
# That's none of the other crontabs does.

Shell=/bin/sh
Path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m H Dom Mon Dow UserCommand
* * * *root CD/&& run-parts--report/etc/cron.hourly
6* * *roottest-x/usr/sbin/anacron | | (CD/&& run-parts--report/etc/cron.daily)
6* * 7roottest-x/usr/sbin/anacron | | (CD/&& run-parts--report/etc/cron.weekly)
* *roottest-x/usr/sbin/anacron | | (CD/&& run-parts--report/etc/cron.monthly)
*/59 * * *root sh/alidata/runall.sh Monitor >>/alidata/log/monitor.log
#

-------------------------------finished-------------------------------------

Timing monitoring in Linux environment with small white writing

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.