0

I have a situation where I am deleting the crontab and then recreate it. So I do crontab -r and then crontab -e.

The problem I have is that crontab -e opens up nano, and I'd like a command line that can do crontab -e then send the F3 and F2 keys, which are for save and exit.

I need to this happen since I will be sending the commands via an ssh connection so nano will not be used interactively.

I am doing this to have crontab automatically create itself a brand new crontab file with all correct permissions and header.

Thank you ionut

IonutN
  • 1

1 Answers1

1

No need to use any interactive editor.

Write the new schedule to a file and then simply call:

crontab  file 

See the crontab man page.

Phill W.
  • 1,479
  • 7
  • 7