How do you monitor DejaDup's progress?
Solution 1:
I think you can monitor it like this:
using ps, get the PID and the log fd, e.g.
$ ps aux | grep duplicity
username 12345 97.2 4.9 878235 345123 ? Rsl 02:21 15:02 python2 /usr/bin/duplicity --exclude=/run/media/..... --tempdir=/home/username/.cache/deja-dup/tmp --log-fd=18
The PID is 12345, and the file descriptor is 18.
Then go to /proc/PID/fd (/proc/12345/fd)
and instead of trying to tail the file descriptor 18, use cat or grep.
$ cat 18
This shows way too much info for me. 90% of it are my exclude globs.
$ grep "examining path" 18
works well for seeing which file is being examined. If you look at the output, you can also focus on when it finds files match (and don't need backing up) or when they're different.
Solution 2:
Based on the solution provided by @RichardSchwarting I created the following command that checks if the process is running an does the cat on /proc/x/fd/y
:
pid=$(pgrep -n duplicity); if [ $pid ]; then fd=$( ps -o cmd --no-headers $pid | sed -E 's/.+(log-fd=[0-9]+).?/\1/' | cut -f2 -d =); if [ $fd ]; then cat /proc/$pid/fd/$fd; else echo "fd not found"; fi else echo "pid not found"; fi