Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

crontab -e calls within java program

 
jm mccabe
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
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,
Julie.
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic