Cron job stopped working as used to

ogarek

Cadet
Joined
Jan 31, 2020
Messages
0
Hello,
When was running FreeNAS 11.3 U1 or U2 if I am not mistaken my script was running correctly with Cron job. The script I have created, mounts smb share from my another Synology NAS, copy selected file, then unmounts smb share. Script itself is located in root directory and looks as shown below:

####
mount smbfs -N -I 10.0.10.11 //username@10.0.10.12/share /tempmnt
cp /folder/file.txt /tempmnt/'date +%m%d%y% %H%M.txt
umount /tempmnt
####

The credentials for smb share are stored in nsmb.conf file, and the cron job is set to be run as a root. Everything was working correctly for about 1 month, until I have decided to update FreeNAS to 11.3-U3.2. After that I am getting email with the messages:
#####
Key 'PATH' defined before section
Key 'HOME' defined before section
Key 'TERM' defined before section
Key 'PAGER' defined before section
mount_smbfs: unable to open connection: syserr = Authentication error
umount: /tempmnt: not a file system root directory
#####

It looks to me that user credentials for smb share could not be found in nsmb.conf file when running from cron job.
Whenever I run script from CLI - everything works perfectly.
Does U3.2 has any bug in cron job??
I appreciate any halp or sugestions.

Mark
 
Top