Search code examples
linuxunixrsync

How to kill rsync gently?


I'm running rsync on a large number of files, and I want to kill the process without leaving any partial files. Is there a way to kill the process gently? I've been looking through the manpages for rsync and kill, but I can't determine if SIGSTOP or SIGTERM will allow rsync to finish its current file before terminating.


Solution

  • From the rsync man page:

    EXIT VALUES
       0      Success
       ...
       20     Received SIGUSR1 or SIGINT
       ...
    

    so it would seem that either of these signals can be used to stop a transfer.