Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Progress bar during smbclient put

Tags:

linux

bash

I'm trying to show a progress bar during a remote copy using smbclient put, maybe using pv or dialog, or any other option.

The smbclient-put command il working fine:

smbclient //usbrouter/backup --user=myusername mypassword -c "put /media/DOC/BackupAuto/work_backup.tar.gz work_backup.tar.gz"

But I can't find any way the show the progress of the copy. Anyone have a solution/alternative?

Thanks.

like image 535
Nifhel Avatar asked Jul 26 '12 09:07

Nifhel


1 Answers

What I do when I want to check up on a file transfer operation that either doesn't support progress bars or I forgot to start it in a progress bar mode is this.

Figure out the total size of your local copy of the file (work_backup.tar.gz) e.g. with ls, stat or du. Then go to the location of the target file (either with ssh or just cd if it' on the same machine). Issue

watch -- du -h work_backup.tar.gz

This is a bit hacky, but it still works even after starting the respective copy job and it pretty much works with every copy mechanism I can imagine.

like image 163
bitmask Avatar answered Nov 10 '22 00:11

bitmask