Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erase and restore cursor position in output does not work #10613

Open
cyberduck opened this issue Feb 14, 2019 · 4 comments
Open

Erase and restore cursor position in output does not work #10613

cyberduck opened this issue Feb 14, 2019 · 4 comments
Labels
cli Command Line Interface enhancement

Comments

@cyberduck
Copy link
Collaborator

ef2996d created the issue

I've been using the Duck CLI on Windows and whether I redirect output to a file or just let it write to the console window, Duck emits TONS and TONS of lines telling me how much of the file upload has been completed. Seriously ... uploading a 277 GiB file, I got the following output (I also attached the file).

20190211-Magni-NoBack_20190213030501.nbd…
Resolving s3.wasabisys.com…
Opening S3 connection to s3.wasabisys.com…
S3 connection opened…
Authenticating as HKIAYRYIVIYKGMHKPSN8…
Login successful…
Prepare 20190211-Magni-NoBack_20190213030501.nbd (Rename existing)…
Prepare 20190211-Magni-NoBack_20190213030501.nbd (Rename existing)…
Calculate checksum for 20190211-Magni-NoBack_20190213030501.nbd…
Uploading 20190211-Magni-NoBack_20190213030501.nbd…
[▮                             ] 0 B of 277.0 GiB
[▮                             ] 128.0 KiB (131,072 bytes) of 277.0 GiB (0%, 2.0 KB/sec, 42326.1 hours remaining)
[▮                             ] 288.0 KiB (294,912 bytes) of 277.0 GiB (0%, 4.4 KB/sec, 18844.3 hours remaining)

      more than 175,000 lines like the above, followed by

[▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮  ] 277.0 GiB (297,375,286,636 bytes) of 277.0 GiB (99%, 25.4 MB/sec, 1 seconds remaining)
[▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮  ] 277.0 GiB (297,376,892,268 bytes) of 277.0 GiB (99%, 25.4 MB/sec, 1 seconds remaining)
[▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮  ] 277.0 GiB (297,378,465,132 bytes) of 277.0 GiB (99%, 25.4 MB/sec, 1 seconds remaining)
Transfer incomplete…
Upload 20190211-Magni-NoBack_20190213030501.nbd failed. Your proposed upload exceeds the maximum allowed size. Please contact your web hosting service provider for assistance.

I can use the -q or --quiet parameters, but then I get NOTHING. It would be great if I could simply skip all the noise. Maybe a -n or --NoPercent parameter to suppress all the percent completed stats, and just get the task header and result?

PLEASE!! :-)


Attachments

@cyberduck
Copy link
Collaborator Author

@dkocher commented

In a bash shell the transfer progress message should be replaced instead of adding a new line. What shell do you use to execute the command?

@cyberduck
Copy link
Collaborator Author

ef2996d commented

Running in the Windows 8.1 and Windows 10 default Windows shell (not PowerShell), from either a Batch file or command window.

In Windows 8.1, multiple output lines appear both when Duck output is redirected to a file and when it is not (output emitted in a command window).

In Windows 10, multiple output lines appear only when Duck output is redirected to a file. When output is not redirected (output emitted in a command window), the same output line is repeatedly overwritten, as intended.

My goal is to be able to redirect output to a log file without all the extra lines. I don't know how you would do that ... if the newline is not written you will likely just get all of that output on one line. And I don't know if there is any way for Duck to be aware that its output has been redirected. Hence the request for a command line option to suppress the transfer stats.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

I suggest that you use --quiet and check the exit code of the program.

@cyberduck
Copy link
Collaborator Author

ef2996d commented

I have been using -q and then examining the return code from Duck, but Duck does not seem to provide a return code.

Here is my batch script code:

echo Wasabi user for %bckFolder% is "%wasUser%", folder is "%wasBckFolder%"  >> %logFile%
echo executing copy loop ...  >> %logFile%
for /F "tokens=*" %%A in (\\Odin\Backup-Staging\%bckFolder%\FileList.txt) do (
  echo %date% %time% Command = duck  -q -P -e rename --upload wasabisys://%wasUser%@%wasBckFolder%/%bckFolder%/ \\odin\Backup-Staging\%bckFolder%\%%A  >> %logFile%
  start /wait duck  -q -P -e rename --upload wasabisys://%wasUser%@%wasBckFolder%/%bckFolder%/ \\Odin\Backup-Staging\%bckFolder%\%%A  >> %logFile%
  echo Done %date% %time%, errorlevel = %errrorlevel%  >> %logFile%
)
echo Copy loop complete %date% %time%  >> %logFile%

Note the line at the end of the do loop:

echo Done %date% %time%, errorlevel = %errrorlevel% >> %logFile%

and here is the log file text

executing copy loop ...   
Thu 01/24/2019 17:03:03.23 Command = duck  -q -P -e rename --upload wasabisys://T5ZHIOV9VGMNBAKU1HQ4@Blaise-Backup/Magni/ Z:/Backup-Staging/Magni/20190121-Magni-Daily_20190124014500.nbd   

Upload complete…
Done Thu 01/24/2019 17:03:03.23, errorlevel =    
Copy loop complete Thu 01/24/2019 17:05:52.23   

the errorlevel appears not to be set ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command Line Interface enhancement
Projects
None yet
Development

No branches or pull requests

2 participants