Page 2 of 2

Re: Question/issue with Greyhole checksums command and cron

Posted: Tue Jan 28, 2014 4:03 pm
by arthurdent4242
When I run the command manually from the command line the command executes just fine, however when I try to run it as a cron job I receive an error

Code: Select all

fsck: Found a share (Books) defined in /etc/greyhole.conf with no path in /etc/samba/smb.conf. Either add this share in /etc/samba/smb.conf, or remove it from /etc/greyhole.conf, then restart Greyhole.
What is the exact command you execute? What user is it executed with, from the command line?
What is the exact cron line, and in what file is it defined (if defined in crontab, for what user)?
Also: see https://github.com/gboudreau/Greyhole/wiki/GetHelp > Gather system information
I think I know what is happening: the testparm executable is used to get your Samba config.
It's used without specifying a path, so the current user's PATH is used to find it. When run within cron, you're probably missing the /usr/bin/ folder in your PATH, thus why you get this error.

Ref: http://askubuntu.com/questions/23009/re ... s-not-work
I will have a look at the link. In the meantime, the command that is being issued is being issued from the root user crontab and it is "greyhole --fsck --checksums". Here is the relevant snippet from the crontab:

Code: Select all

0 23 * * 6 greyhole --fsck --checksums # JOB_ID_7
From a syntax standpoint, I don't think that something is wrong with the crontab entry, what are your thoughts?

Re: Question/issue with Greyhole checksums command and cron

Posted: Tue Jan 28, 2014 4:20 pm
by gboudreau
From a syntax standpoint, I don't think that something is wrong with the crontab entry, what are your thoughts?
It's fine. It's just that your cron environment is missing /usr/bin/ (or whatever your testparm executable is in) in it's PATH variable.