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
Post a Comment