Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
49
rated 0 times [  49] [ 0]  / answers: 1 / hits: 69323  / 2 Years ago, fri, june 17, 2022, 5:03:04

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?


More From » rsync

 Answers
5

You can do (in POSIX shells, including bash):


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

Or in zsh:


strace -e open,openat -p${^$(ps -o lwp= -LC rsync)}

Or in fish


strace -e open,openat -p(ps -o lwp= -LC rsync)

Or in rc/es:


strace -e open,openat -p`{ps -o lwp= -LC rsync}

To see what it's doing, or


lsof -ad3-999 -c rsync

to see what files it currently has opened.


[#30227] Friday, June 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brasiplacar

Total Points: 314
Total Questions: 124
Total Answers: 97

Location: Dominican Republic
Member since Wed, Mar 17, 2021
3 Years ago
brasiplacar questions
Sat, Sep 4, 21, 13:11, 3 Years ago
Tue, Jan 10, 23, 06:22, 1 Year ago
Wed, Oct 13, 21, 15:19, 3 Years ago
Wed, May 4, 22, 00:06, 2 Years ago
Thu, Jan 5, 23, 15:40, 1 Year ago
;