linux - How to disable CTRL-C during scp? -


i want script able finish scp, if ctrl+c entered. have tried using trap disable ctrl+c, not work when scp in progress. scp terminates immediately. there way this? code below. pretty simple.

#!/bin/bash trap '' sigint sigterm scp -q user@server:/backup/large_file.txt /local/dir/ 

update: make sure have "set -m" @ top of script.

put in background in subshell disconnect terminal.

(scp ... &)

edit: you'll want redirect errors file.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -