Progress bar/% in duplicity?
This functionality has (finally) been added to Duplicity since version 0.6.22 on 2013/08/22. The feature is activated with the --progress
option.
PARTIAL SOLUTION:
Progress can be monitored using the pv
function. It's especially useful when backing up large files. It is not that useful with many small files, but allows to see progress on currently opened file and the upload speed. pv
is not installed by default.
How to use pv
: First grab the process id, and then put it as a parameter to pv -d
.
Example:
ps -ef | grep duplicity
We read the PID (first number after the username), then
pv -d PID
Or a one-liner*:
*assuming we are copying a file that has "disk" in it's name. The second grep narrows the search results.
pv -d $(ps -ef | grep duplicity | grep disk | tr -s ' ' | cut -d ' ' -f 2)
where:
-d
tells pv to expect PID of the process to monitor,
ps -ef
prints the list of processes running on the machine,
grep duplicity
grabs only the lines from the process list that contain duplicity,
grep disk
avoids the first grep process from showing in the ps -ef results and makes sure, that we only list the particular process that we want to monitor by looking for part of the name of the copied file,
tr -s ' '
trims multiple spaces in ps -ef output to just one, so that cut can work properly,
cut -d ' ' -f 2
cuts only the second field from the output (our PID) and uses ' ' spaces as field separators. without the previous trim, cut wouldn't work (variable amount of spaces in ps -ef output).
pv -d in action