How to move the config & database?

I’m attempting to move Syncthing’s configuration and database to an external USB drive, as advised here.

Here’s the original home path from my service config:

ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 -home=/home/admin/.config/syncthing

…and here’s what I changed it to, after running sudo rsync -r /home/admin/.config /media/pi/Elements:

ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 -home=/media/pi/Elements/.config/syncthing

Here’s what systemctl status reports:

pi@OFFSITE:/media/pi/Elements $ sudo systemctl status syncthing@admin.service
* syncthing@admin.service - Syncthing service for admin
     Loaded: loaded (/etc/systemd/system/syncthing@admin.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/syncthing@admin.service.d
             `-override.conf
     Active: failed (Result: exit-code) since Fri 2023-02-17 17:35:29 AKST; 1min 57s ago
    Process: 64338 ExecStartPre=/home/pi/Documents/Scripts/mount-sync-drive.sh (code=exited, status=0/SUCCESS)
    Process: 64340 ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 -home=/media/pi/Elements/.config/syncthing (code=exited, status=1/FAILURE)
   Main PID: 64340 (code=exited, status=1/FAILURE)
        CPU: 74ms

Feb 17 17:35:29 OFFSITE systemd[1]: Starting Syncthing service for admin...
Feb 17 17:35:29 OFFSITE systemd[1]: Started Syncthing service for admin.
Feb 17 17:35:29 OFFSITE syncthing[64340]: WARNING: Failure on home directory: mkdir /media/pi/Elements/.config/syncthing: permission denied
Feb 17 17:35:29 OFFSITE systemd[1]: syncthing@admin.service: Main process exited, code=exited, status=1/FAILURE
Feb 17 17:35:29 OFFSITE systemd[1]: syncthing@admin.service: Failed with result 'exit-code'.

I’m not sure why it’s trying to create that syncthing directory, as the directory already exists. I’ve verified such manually, as well as checked its permissions against the original.

Clearly I’ve missed something here, but I’m not spotting what it is.

Any suggestions?

Could you post the output of ls -lah for that directory?

That was it, thank you!

owner:group was set to root on the hierarchy, presumably because I’d run rsync under sudo. (Not sure how I missed that earlier.)

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