Score:0

Send keys over ssh connection to nano editor

ru flag

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

Score:1
cn flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.