File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes crontab -e calls within java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "crontab -e calls within java program" Watch "crontab -e calls within java program" New topic

crontab -e calls within java program

jm mccabe

Joined: Sep 18, 2003
Posts: 1
I want to create a user cron job from a java program. I know how to make system calls but since the command
crontab -e
opens an editor, I dont think this is possible. It would be great if anybody had ideas or suggestions on this. I looked into the TimerTask class but it is not suitable as it does not guarantee real time.
Help apprecipated,
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

Just curious, but what is to prevent you from opening the crontab file and appending a new entry to the file (system security, not knowing where the crontab file is, etc.)?
Many years ago I wrote a little utility that would read/write crontab files in Objective-C; maybe I could dig it up and redo it as a Java package.

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
I agree. Here's the link:
subject: crontab -e calls within java program
jQuery in Action, 3rd edition