TheChymera / mkstage4

Bash Utility for Creating Stage 4 Tarballs
GNU General Public License v3.0
104 stars 22 forks source link

Progress bar #47

Open GrabbenD opened 2 years ago

GrabbenD commented 2 years ago

This tool is a lifesaver but with larger system installations it can take quite a while to finish and a progress bar would be very useful. For instance, when using the dd tool this can be accomplished with fsync:

dd if=/dev/nvme0n1p3 bs=4M status=progress conv=fsync | bzip2 > /mnt/nvme1n1/backup.bz2

Are there actually any existing methods to view the progress of mkstage4?

TheChymera commented 1 year ago

I agree that this could be useful, though I'm not entirely sure how to do this in a way that supports the various compression algorithms. If you have a suggestion I'd be happy to review it.

GrabbenD commented 1 year ago

Good point @TheChymera

I've switched to NixOS since Gentoo was consuming too much of my free time. Nix ecosystem also offers incredibly fast rollbacks and OS configuration switching

antonellocaroli commented 1 year ago

@TheChymera it would probably suffice to add to

TAR_OPTIONS=(
    -cpP
    --ignore-failed-read
    "--xattrs-include=*.*"
    --numeric-owner
        --checkpoint=.500
    "--use-compress-prog=${COMP_OPTIONS[*]}"
    )
TheChymera commented 1 year ago

@antonellocaroli that just prints a period every 0.5 seconds, not really a progress bar since it's not relative to anything. Not sure if tar can even correctly guess how far into the operation it is.

I guess the --checkpoint-action parameter might be usable to contrive something, but this and other approaches I could track down, seem to gobble stdout, which is quite vital to notify you of any files that might have changed while reading...