Ubuntu – Monitor/Watch running rsync process


I have an rsync job that has been added to a crontab and when it's running, I can only check that there's a rsync PID and confirm with htop that it's eating up n amount of CPU and RAM.

What I'd like to do is to monitor what files are actually being rsync'ed in realtime…when I want to. FYI I haven't passed any verbose option to the command nor have I added some logging. I really just want to check what's being rsync'ed on demand.

Any idea how I could achieve that?

Best Answer

  • You can do:

    strace -e open $(ps -o lwp= -LC rsync | sed 's/^/-p/')

    To see what it's doing, or

    lsof -ad3-999 -c rsync

    to see what files it currently has opened.