开发者

An agenda in Korn Shell: New / Edit / Delete / View appointment

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
  • E开发者_Python百科dit 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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜