Syncthing on DIetPi start from an external HDD on reboot

Hi, I have a basic Syncthing distribution on a Raspberry with DietPi, and it works correcty. I save the distribution on an external HDD and I mount this HDD on startup. I’m not able to start Syncthing automatically on reboot. I create a little script Start_Syncthing.sh like this

#!/bin/sh /mnt/BackUp/Software_Syncthing/syncthing --home=config

and it works correcly, but if I try to put this script on crontab

@reboot sleep 60 && root /mnt/BackUp/Software_Syncthing/Start_Syncthing.sh

it doesn’t work. So, I’m not a good Linux user, but I can’t find a solution on my problem. Sorry for my little english :slight_smile:

Not an expert either, but what is root supposed to do in the cron script?

That’s relative to the current directory of the shell when you start Synching. You probably want to give an absolute path here to make sure it refers to the right place when started by cron. And, what Tomasz asks…

I try with “root” and without “root” and, it’s the same. And if I launch the script it works. The problem is in the cron configuration.

The reason for the script not working is likely what @calmh above about the folder path, but if you don’t know what root is doing there, then you should definitely remove it.

I’ve got a feeling what you need is the following.

#!/bin/sh
/mnt/BackUp/Software_Syncthing/syncthing --home=/mnt/BackUp/Software_Syncthing/syncthing/config
1 Like

It works! This is the correct path for my config.

/mnt/BackUp/Software_Syncthing/syncthing --home=/mnt/BackUp/Software_Syncthing/syncthing/config

Thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.