Search code examples
perlsshrsync

How to stop the rsync process by system("ssh host rsync...")?


I wrote like this Perl script.(/tmp/file is fuge)

system("ssh host1 'rsync -av /tmp/file host2:/tmp/'");

Then, I run this script, and kill by Ctrl+C.

The script has been stopped, but rsync process on host1 is still running.

How to stop the rsync process by Ctrl+C?


Solution

  • try

    system("ssh -t host1 'rsync -av /tmp/file host2:/tmp/'");