Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

589
Visualizações
Samba Client (smbclient) always writes to standard error when getting files

I am getting some files via an smb client (I use version 4.13.14-Ubuntu) command:

smbclient //<myip>/<myshare> -c "prompt;cd myPath; mget *.csv;" -U <myuser> 2> logs.txt

This command results in the text file containing

getting file \myPath\dde_DC-Machine-99999901-DeviceId_20210624.csv of size 3710 as dde_DC-Machine-99999901-DeviceId_20210624.csv (13.6 KiloBytes/sec) (average 13.6 KiloBytes/sec)

Which shows the file has been successfully downloaded (which is actually the case, the file is completely available after executing the command).

However, as you see from the standard error redirection "2>", the logs on success are written to stderr where I would expect them on stdout.

Now when I add some invalid parameters like a non existing path

smbclient //<myip>/<myshare> -c "prompt;cd nonExistingPath; mget *.csv;" -U <myuser> 2> logs.txt

The terminal prints NT_STATUS_OBJECT_NAME_NOT_FOUND which is correct but coming from the standard out whereas the standard error is empty.

It almost looks like the client writes to the stdout if an error occurs and to the stderr if everything works fine, so exactly the wrong way around. Beware this happens only when using the mget or get commands, other commands I've tested seem to work as they should.

Question

Is there a bug in the smbclient, or a misunderstanding from my side?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Check if Samba config file (/usr/local/samba/lib/smb.conf) contains the '-E'.

"-E Sends output from commands to stderr instead of stdout."

https://www.samba.org/samba/docs/using_samba/appc.html

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda