LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 07-08-2003, 03:28 AM   #1
karleong
LQ Newbie
 
Registered: Jul 2003
Location: malaysia
Posts: 21

Rep: Reputation: 15
HELP!! crontab


Help~~!
Does anyone know how to run a java application using crontab?
Please give me some example, thanks.
 
Old 07-08-2003, 05:39 AM   #2
kuyalfinator
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: 118

Rep: Reputation: 16
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
 
Old 07-09-2003, 01:23 AM   #3
karleong
LQ Newbie
 
Registered: Jul 2003
Location: malaysia
Posts: 21

Original Poster
Rep: Reputation: 15
I had try it already, but they don't have any example about how to run a java application.
 
Old 07-09-2003, 03:38 AM   #4
Qex
LQ Newbie
 
Registered: Jul 2003
Location: Reykjavík
Distribution: RedHat 9
Posts: 9

Rep: Reputation: 0
I have not done this but make sure that the file is executable...chmod 755
 
Old 07-10-2003, 04:31 AM   #5
kuyalfinator
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: 118

Rep: Reputation: 16
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
 
Old 07-11-2003, 02:43 AM   #6
karleong
LQ Newbie
 
Registered: Jul 2003
Location: malaysia
Posts: 21

Original Poster
Rep: Reputation: 15
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?
 
Old 07-11-2003, 05:04 AM   #7
cmfarley19
Member
 
Registered: Nov 2002
Location: Central VA
Distribution: Ubuntu/Debian
Posts: 228

Rep: Reputation: 32
Have YOU tried it before?
 
Old 07-11-2003, 09:39 AM   #8
karleong
LQ Newbie
 
Registered: Jul 2003
Location: malaysia
Posts: 21

Original Poster
Rep: Reputation: 15
$java MyClassName
can run in the terminal.
But i don't know how to make it run by using crontab.
 
Old 07-11-2003, 09:48 AM   #9
cmfarley19
Member
 
Registered: Nov 2002
Location: Central VA
Distribution: Ubuntu/Debian
Posts: 228

Rep: Reputation: 32
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.
 
Old 07-12-2003, 10:54 AM   #10
karleong
LQ Newbie
 
Registered: Jul 2003
Location: malaysia
Posts: 21

Original Poster
Rep: Reputation: 15
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab x2??? killahsmurf Slackware 2 05-24-2005 10:53 PM
Crontab wormraper Debian 4 05-15-2005 01:01 AM
using crontab goodolday Linux - Newbie 1 04-26-2005 07:16 PM
How to use crontab ? Dakkar Linux - Newbie 2 01-22-2004 10:49 AM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration