Skip to content

Copy files asynchronously with progress bar with gcp (not rsync) #1057

Answered by og900aero
og900aero asked this question in Q&A
Discussion options

You must be logged in to vote

Best way wit advanced copy and move program: https://github.com/jarun/advcpmv

cmd paste &{{
	size=$(wc -c ~/.local/share/lf/files | awk '{print $1}')
	set -- $(cat ~/.local/share/lf/files)
	mode="$1"
	shift
    case "$mode" in
		copy)
			# rsync -ah --info=progress2 -- "$@" . |
    		advcp -ag "$@" . | grep -Po --line-buffered "(?<=^\033\[K).+%$" | sed -nu 'p;n' |
    		stdbuf -i0 -o0 -e0 tr '\r' '\n' |
    		while IFS= read -r line; do
	    		lf -remote "send $id echo '$line'"
    		done
			;;
		move)
			if [ $size -gt 5 ]; then 
				advmv -fg "$@" . | grep -Po --line-buffered "(?<=^\033\[K).+%$" | sed -nu 'p;n' |
				while IFS= read -r line; do
					lf -remote "send $id echo '$line'"
		…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by og900aero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant