Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

574
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda