SyncThing

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
stevil2k
Posts: 5
Joined: Fri Nov 05, 2021 3:47 pm
Has thanked: 1 time

SyncThing

Unread post by stevil2k »

Hello, does anyone have syncthing working properly on their mister setups? I can get the ARM binary to run from command line but struggling to get it to run at boot. Steps taken so far are to create an init.d script called /etc/init.d/S52syncthing which I can start and stop from the command line but it wont start at boot. Second idea was to use the S99user - user-startup.sh which also will start stop and restart from CMD but wont start at boot.

I understand that some distros require you to run update-rc.d however, I cannot find it in the usual /usr/sbin folder.

Any help would be appreciated.

Steve
AngelicLiver
Top Contributor
Posts: 433
Joined: Fri May 29, 2020 8:50 am
Has thanked: 86 times
Been thanked: 120 times

Re: SyncThing

Unread post by AngelicLiver »

That doesn't sound like the best of ideas. MiSTer isn't really meant to be used this way; the linux configuration is purposefully lean and the filesystem is intended to be largely read-only. Adding another service running in the background is asking for trouble imho.

I know there are scripts to allow you to sync saves with Google Drive or RClone anywhere you like, have you considered using those instead?
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: SyncThing

Unread post by jca »

I don't know about your script but I have one in /etc/init.d with the form S99xxx and it starts on bootup.
stevil2k
Posts: 5
Joined: Fri Nov 05, 2021 3:47 pm
Has thanked: 1 time

Re: SyncThing

Unread post by stevil2k »

jca wrote: Fri Nov 05, 2021 6:40 pm I don't know about your script but I have one in /etc/init.d with the form S99xxx and it starts on bootup.
Good to know its possible! Where are you putting the syncthing binary? Maybe naming the script S99syncthing would help.
stevil2k
Posts: 5
Joined: Fri Nov 05, 2021 3:47 pm
Has thanked: 1 time

Re: SyncThing

Unread post by stevil2k »

AngelicLiver wrote: Fri Nov 05, 2021 6:36 pm That doesn't sound like the best of ideas. MiSTer isn't really meant to be used this way; the linux configuration is purposefully lean and the filesystem is intended to be largely read-only. Adding another service running in the background is asking for trouble imho.

I know there are scripts to allow you to sync saves with Google Drive or RClone anywhere you like, have you considered using those instead?
I agree that adding services may add to stability issues but I also think there is merit in using this particular sync software over Gdrive and Rclone. Being able to seamlessly sync all my ROMS, HDF files and and save states across multiple platforms to use on either other Misters or emulators on phones, tablets, laptops, PCs seems worth trying. Of course, it could also end up as one big mess, long as I have a robust enough backup of my SD card then there is no real danger.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: SyncThing

Unread post by jca »

stevil2k wrote: Fri Nov 05, 2021 8:02 pm
jca wrote: Fri Nov 05, 2021 6:40 pm I don't know about your script but I have one in /etc/init.d with the form S99xxx and it starts on bootup.
Good to know its possible! Where are you putting the syncthing binary? Maybe naming the script S99syncthing would help.
I should have been more explicit, my script is not about syncthing but keeping my HDD spinning. It was just to tell you that it starts properly at boot so yours should also start. Did you try it manually and does it work?
AngelicLiver
Top Contributor
Posts: 433
Joined: Fri May 29, 2020 8:50 am
Has thanked: 86 times
Been thanked: 120 times

Re: SyncThing

Unread post by AngelicLiver »

stevil2k wrote: Fri Nov 05, 2021 8:11 pm
AngelicLiver wrote: Fri Nov 05, 2021 6:36 pm That doesn't sound like the best of ideas. MiSTer isn't really meant to be used this way; the linux configuration is purposefully lean and the filesystem is intended to be largely read-only. Adding another service running in the background is asking for trouble imho.

I know there are scripts to allow you to sync saves with Google Drive or RClone anywhere you like, have you considered using those instead?
I agree that adding services may add to stability issues but I also think there is merit in using this particular sync software over Gdrive and Rclone. Being able to seamlessly sync all my ROMS, HDF files and and save states across multiple platforms to use on either other Misters or emulators on phones, tablets, laptops, PCs seems worth trying. Of course, it could also end up as one big mess, long as I have a robust enough backup of my SD card then there is no real danger.
Hey power to you for trying these things out, it just seems like a very roundabout way of doing it. SD wear aside SyncThing is relatively resource intensive for a little dual core 800MHz Cortex-A9.

SMB/CIFS support is great, if you have a NAS maybe consider running SyncThing on that?
stevil2k
Posts: 5
Joined: Fri Nov 05, 2021 3:47 pm
Has thanked: 1 time

Re: SyncThing

Unread post by stevil2k »

jca wrote: Sat Nov 06, 2021 1:48 am
stevil2k wrote: Fri Nov 05, 2021 8:02 pm
jca wrote: Fri Nov 05, 2021 6:40 pm I don't know about your script but I have one in /etc/init.d with the form S99xxx and it starts on bootup.
Good to know its possible! Where are you putting the syncthing binary? Maybe naming the script S99syncthing would help.
I should have been more explicit, my script is not about syncthing but keeping my HDD spinning. It was just to tell you that it starts properly at boot so yours should also start. Did you try it manually and does it work?
Yeah running S99syncthing start works as expected. I think I will take AngelicLiver's advice on this one and look at an alternative way.
stevil2k
Posts: 5
Joined: Fri Nov 05, 2021 3:47 pm
Has thanked: 1 time

Re: SyncThing

Unread post by stevil2k »

AngelicLiver wrote: Sat Nov 06, 2021 9:17 am
stevil2k wrote: Fri Nov 05, 2021 8:11 pm
AngelicLiver wrote: Fri Nov 05, 2021 6:36 pm That doesn't sound like the best of ideas. MiSTer isn't really meant to be used this way; the linux configuration is purposefully lean and the filesystem is intended to be largely read-only. Adding another service running in the background is asking for trouble imho.

I know there are scripts to allow you to sync saves with Google Drive or RClone anywhere you like, have you considered using those instead?
I agree that adding services may add to stability issues but I also think there is merit in using this particular sync software over Gdrive and Rclone. Being able to seamlessly sync all my ROMS, HDF files and and save states across multiple platforms to use on either other Misters or emulators on phones, tablets, laptops, PCs seems worth trying. Of course, it could also end up as one big mess, long as I have a robust enough backup of my SD card then there is no real danger.
Hey power to you for trying these things out, it just seems like a very roundabout way of doing it. SD wear aside SyncThing is relatively resource intensive for a little dual core 800MHz Cortex-A9.

SMB/CIFS support is great, if you have a NAS maybe consider running SyncThing on that?
Thanks for the suggestion, I think, as you pointed out, the strain on the SD card might be too much. I do have a NAS which is already running SyncThing so will investigate SMB/CIFS suggestion instead.
User avatar
Wave
Posts: 132
Joined: Tue Jan 04, 2022 6:57 pm
Has thanked: 93 times
Been thanked: 42 times

Re: SyncThing

Unread post by Wave »

stevil2k wrote: Mon Nov 08, 2021 6:10 pm Thanks for the suggestion, I think, as you pointed out, the strain on the SD card might be too much. I do have a NAS which is already running SyncThing so will investigate SMB/CIFS suggestion instead.
I'm curious what you ended up doing. As you note, SyncThing would be a great boon for keeping MiSTers synced/backed up, but it does seem less than ideal to have it always running as a service.

(I wonder if it'd be feasible to run it on demand from a script, and then close it when it finishes current jobs. Or just reboot to close it.)
dot-bob
Posts: 18
Joined: Wed May 27, 2020 4:40 pm
Has thanked: 1 time
Been thanked: 15 times

Re: SyncThing

Unread post by dot-bob »

I typically start syncthing under a script custom as needed. I find it can affect performance of the linux side of things and strange things can happen.

I also don't use it to sync roms as it can take hours just to scan everything to look for changes let alone transfer them. Roms don't change very often and I typically use FreeFileSync to sync the roms. I only use syncthing to sync settings, saves, and savestates between my NAS, two mister handhelds, and console setup.

It's also very important for the time be accurate on every system else the files can be overwritten by older versions.
User avatar
ericgus09
Posts: 217
Joined: Mon May 25, 2020 2:47 am
Has thanked: 11 times
Been thanked: 32 times

Re: SyncThing

Unread post by ericgus09 »

dot-bob wrote: Sat Jan 08, 2022 7:04 am I typically start syncthing under a script custom as needed. I find it can affect performance of the linux side of things and strange things can happen.

I also don't use it to sync roms as it can take hours just to scan everything to look for changes let alone transfer them. Roms don't change very often and I typically use FreeFileSync to sync the roms. I only use syncthing to sync settings, saves, and savestates between my NAS, two mister handhelds, and console setup.

It's also very important for the time be accurate on every system else the files can be overwritten by older versions.
You run syncthing on the mister itself? if so which arm binary did you use and how did you configure it since it seems to want to use a web addr on localhost .. kinda curious how you configured it ..I am also interested in doing an rsync sorta thing just for config files and such (no roms or hard disk/floppy images) .. would be very interested if you could elaborate and share how you got it all set up .. I want to do the same sorta thing, run it on demand from the mister scripts menu and say sync it over to my NAS .. I had been looking at rysnc but this tool seems nicer.
dot-bob
Posts: 18
Joined: Wed May 27, 2020 4:40 pm
Has thanked: 1 time
Been thanked: 15 times

Re: SyncThing

Unread post by dot-bob »

ericgus09 wrote: Sat Jan 08, 2022 7:18 am You run syncthing on the mister itself? if so which arm binary did you use and how did you configure it since it seems to want to use a web addr on localhost .. kinda curious how you configured it ..I am also interested in doing an rsync sorta thing just for config files and such (no roms or hard disk/floppy images) .. would be very interested if you could elaborate and share how you got it all set up .. I want to do the same sorta thing, run it on demand from the mister scripts menu and say sync it over to my NAS .. I had been looking at rysnc but this tool seems nicer.
You can run the standard 32 bit ARM version the packaged named something like syncthing-linux-arm-v1.XX.X.tar.gz. I created extracted it to a directory /media/fat/syncthing,

I placed a "start_syncthing.sh" script under /media/fat/Scripts with the content:

Code: Select all

#!/bin/bash

BASE_PATH="/media/fat/syncthing/config"


"/media/fat/syncthing/syncthing-linux-arm-v1.18.0/syncthing" -home="$BASE_PATH" 2>/dev/null &

echo
echo "syncthing started on port: 8384"
echo
exit 0
I don't recall if I needed to explicitly allow connections from the network vs localhost. If I did I just manually edited the config to allow it then configured the rest via the web ui. Just remember to use the default port or the port you specified in the URL you use to access it. I just left mine to the default port 8384 as I am never on a public or insecure network.
User avatar
ericgus09
Posts: 217
Joined: Mon May 25, 2020 2:47 am
Has thanked: 11 times
Been thanked: 32 times

Re: SyncThing

Unread post by ericgus09 »

Excellent thank you!
Post Reply