Restart SAMBA-server automatically after reboot

Hello,

Since I moved with nextcloud (nextcloudpi) to a Raspberry Pi 4 the following situation:
Sometimes (usually once a month) the Raspberry Pi reboots. I haven’t found out yet why and who is the culprit.
In this case I have to restart the SAMBA server: service smbd restart

How can I create a cron here so that the server is automatically started on restart as well?
Thank you in advance for your support.

having the exact same problem here, but for openHAB, not ncp.
Have you tried systemctl enable smbd and chkconfig smbd on ? This should solve it (but doesn’t work for me for openhab)

I also tried to use crontab -e to add @reboot PATH/startsamba.sh to this file which is pointing to a .sh (shell script) containing
#!/bin/sh
service smbd restart
Made it executable by entering xhmod +x PATH/startsamba.sh command.
Unfortunately not working either.