Como posso configurar o nano para salvar a cada 10 segundos?

3

Eu preciso que meu editor nano seja salvo automaticamente a cada 10 segundos ou em algum período de tempo específico. Como posso conseguir isso?

    
por rɑːdʒɑ 14.05.2013 / 06:41

1 resposta

1

Não é possível fazer nano salvar automaticamente o arquivo que você está editando em um período de tempo específico. Você pode salvar um arquivo toda vez que quiser sem sair de nano com Ctrl + O ("O" de "Omega", não zero) ou F3 .

Mas, não se preocupe, salva automaticamente os backups. Consulte o link :

If you have been using nano, you may see files with the ".save" extension appearing in directories in which you are working. If you are editing a file (let's call it "hello.c") on a server and somehow your connection to the server is lost, whether because you closed the terminal window or you lost your connection to the internet or some other unknown reason, nano will automatically save a backup of the state of the file in a new file with a ".save" extension (e.g. "hello.c.save"). So, when you log back onto server, don't worry that you've lost everything you've been working on because you hadn't saved for an extended period of time, you can simply open up the ".save" file and then continue from where you left off, and when you go to save the file, you can save it with the name of the original file (without the ".save" extension). Don't rely entirely on this though, such as thinking you can just close your terminal window without saving because nano has got you covered, because in a very few cases the file is not correctly created.

If a ".save" file already exists and you open up the file without the ".save" extension, and your connection is lost again, nano will save the file with a ".save.1" extension, incrementing the number at the end of the extension for each time. If you have open a file without a name and lose your connection, the file will automatically be saved with the name "nano.save".

Dito isso, não vejo nenhum motivo para preocupação com os arquivos salvos automaticamente em nano .

    
por Radu Rădeanu 14.05.2013 / 08:22