rsync zenity awk

This commit is contained in:
Rodrigo 2023-03-05 17:53:00 +01:00
parent 18e535fdd4
commit 6c52d1dc53
2 changed files with 18 additions and 2 deletions

View file

@ -28,8 +28,10 @@ Migration_init(){
Migration_move(){
origin=$1
destination=$2
rsync --dry-run -avzh "$origin" "$destination" && Migration_updatePaths "$origin" "$destination" | \
stdbuf -i0 -o0 -e0 tr '\r' '\n' | stdbuf -i0 -o0 -e0 awk -W interactive '/^ /{ print int(+$2); fflush(); next}$0{ print "# " $0}' | zenity --progress --width=400 --text="Moving...." --auto-close --title="Migrating your installation"
rsync -av --progress --dry-run "$origin" "$destination" |
awk -f $HOME/.config/EmuDeck/backend/rsync.awk |
zenity --progress --title "Migrating your installation to $destination" \
--text="Scanning..." --width=400 --percentage=0 --auto-kill
}

14
rsync.awk Normal file
View file

@ -0,0 +1,14 @@
{
if (index($0, "to-check=") > 0)
{
split($0, pieces, "to-check=")
split(pieces[2], term, ")");
split(term[1], division, "/");
print (1-(division[1]/division[2]))*100"%"
}
else
{
print "#"$0;
}
fflush();
}