views:

28

answers:

1

As stated in the title, I have to write a simple script which should perform some typical agenda's functions. The script must use crontab. The functions are:

  • Creating a new appointment
  • Edit an existent appointment
  • Delete an appointment
  • List the appointment

I really don't have a clue how to do this, can you help me with some hint? Maybe a bit of sweet code?

Thank you very much, Abaco

EDIT: To be more specific on my question

Point 1: how can I edit a crontab thorugh ksh? How can I insert a new line? Can you link me some documentation or a bit of code about this?

A: 

Here's some code that adds a script that runs at 7:30 AM to your crontab:

typeset CURRENT_CRONTAB=$( crontab -l ) # save the current crontab in a variable

print "${CURRENT_CRONTAB}
30 07 * * * /home/tomd/my_script.ksh" | crontab -

Yours,
Tom

Tom DeGisi

related questions