Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

573
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!