[Samba] smbclient doesn't work from cron

Andrew Masterson andrew.masterson at nuvistaenergy.com
Tue Apr 26 13:16:36 MDT 2011

> -----Original Message-----
> From: samba-bounces at lists.samba.org
[mailto:samba-bounces at lists.samba.org]
> On Behalf Of Bob Miller
> Sent: Tuesday, April 26, 2011 10:09 AM
> To: helmut at hullen.de
> Cc: samba at lists.samba.org
> Subject: Re: [Samba] smbclient doesn't work from cron
> On Tue, 2011-04-26 at 16:04 +0200, Helmut Hullen wrote:
> > > I tell you I've restarted cron daemon and it always fails.
> >
> > > What's wrong in cron line ???
> >
> > One simple way to test the many problems (none of them a samba
> > make a simple (executable) shell script and let cron call this shell
> > script.
> I encountered a couple years ago a problem with a cron command, which
> ended up tracing to cron and the shell (debian system, cannot remember
> exactly if it was a different shell or different handling of the shell
> that cron uses).
> My research led me to a new habit/method of creating cronjobs, one
> forces cron to execute the commands in a bash shell just like you do
> from the command line.  As Helmut suggests, put your commands in a
> and then use the bash command to call the script:
> 0 10 * * * bash /path/to/file/with/commands

My experience also has to do with shell paths not getting set properly,
so I now explicitely state the path of all binaries that I want to run.

/usr/sbin/nmbd -D
/usr/sbin/smbd -D

It's not as robust to transfer between platforms, but it does mean that
cron jobs always work.


More information about the samba mailing list