Not sure if this is the right place to ask, more of a coding type question. I have been given permission to ask this question by @joekamprad provided I supply him with a large crate of beer. Anyway I would like some help with getting a progress bar working in rsync
# location of files
AIROOTFS="/run/archiso/airootfs/"
# NOF = number of files in AIROOTFS
NOF=$(find ${AIROOTFS} -type f | wc -l)
# transfer files in AIROOTFS to new device, show a progress bar
rsync -a --progress $AIROOTFS $MNT/ | pv -lep -s ${NOF} > /dev/null
Not sure if ‘find’ is the correct way to go. Have seen it done this way using ‘du’
# a version using du....
rsync -av source/ destination/ | pv -p -t -r -s $(du -sb source/ | awk '{print $1}') > /dev/null
@Pudge The files are not compressed like ARM image. The /run/archiso/airootfs are normal files and folders which get copied to new install target device. The problem is a user is shown 200%+ as bar progresses which does annoy some even though file transfer works.
I would run without pv if a user just got some indication that something was happening.
Looking on Arch wiki for rsync there is no mention of pv but some info on using progress/progress2 but I think it is more for remote transfers [ssh]