Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
07-08-2003, 03:28 AM
#1
LQ Newbie
Registered: Jul 2003
Location: malaysia
Posts: 21
Rep:
HELP!! crontab
Help~~!
Does anyone know how to run a java application using crontab?
Please give me some example, thanks.
07-08-2003, 05:39 AM
#2
Member
Registered: Jul 2003
Location: Los Angeles
Distribution: RedHat8 2.4.18-14 RedHat9 2.4.20-8 FreeBSD 5.2.1 Ubuntu 10_4 Mandrake 2.4.21-0.13mdk
Posts: 117
Rep:
I used the following command to find out about crontab
$man crontab
DESCRIPTION
Crontab is the program used to install, deinstall or list the tables
used to drive the cron(8) daemon in Vixie Cron. Each user can have
their own crontab, and though these are files in /var, they are not
intended to be edited directly .
trying using these commands to research more about cron and crontab
$man -S5 cron
$man -S8 crontab
07-09-2003, 01:23 AM
#3
LQ Newbie
Registered: Jul 2003
Location: malaysia
Posts: 21
Original Poster
Rep:
I had try it already, but they don't have any example about how to run a java application.
07-09-2003, 03:38 AM
#4
LQ Newbie
Registered: Jul 2003
Location: Reykjavík
Distribution: RedHat 9
Posts: 9
Rep:
I have not done this but make sure that the file is executable...chmod 755
07-10-2003, 04:31 AM
#5
Member
Registered: Jul 2003
Location: Los Angeles
Distribution: RedHat8 2.4.18-14 RedHat9 2.4.20-8 FreeBSD 5.2.1 Ubuntu 10_4 Mandrake 2.4.21-0.13mdk
Posts: 117
Rep:
http://www.linuxquestions.org/questi...hlight=crontab
Here is another thread that might be a little more helpful. I tried look for the crontab settings, but only got this far.
Code:
$crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.1425 installed on Thu Jul 10 02:15:17 2003)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
$pwd
/etc
$ ls cr*
crontab
cron.d:
cron.daily:
00-logwatch 0anacron logrotate makewhatis.cron rpm slocate.cron tmpwatch
cron.hourly:
cron.monthly:
0anacron
cron.weekly:
0anacron makewhatis.cron
$more crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
07-11-2003, 02:43 AM
#6
LQ Newbie
Registered: Jul 2003
Location: malaysia
Posts: 21
Original Poster
Rep:
thanks for the information,
but the java application that i want to run is
like MyClassName.class.
when it run in a terminal is like:
$java MyClassName
Does anyone had try it before?
07-11-2003, 05:04 AM
#7
Member
Registered: Nov 2002
Location: Central VA
Distribution: Ubuntu/Debian
Posts: 228
Rep:
Have YOU tried it before?
07-11-2003, 09:39 AM
#8
LQ Newbie
Registered: Jul 2003
Location: malaysia
Posts: 21
Original Poster
Rep:
$java MyClassName
can run in the terminal.
But i don't know how to make it run by using crontab.
07-11-2003, 09:48 AM
#9
Member
Registered: Nov 2002
Location: Central VA
Distribution: Ubuntu/Debian
Posts: 228
Rep:
Try editing your crontab file with:
Code:
0 * * * * java MyClassName > /dev/null 2> /dev/null
Where 0 * * * * is the time interval you want it to run.
07-12-2003, 10:54 AM
#10
LQ Newbie
Registered: Jul 2003
Location: malaysia
Posts: 21
Original Poster
Rep:
I don't know why but there don't have any respone
apache is already running and
0 * * * * wall "testing"
can use but it don't run my java apllication
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 11:19 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News