Cant connect to smb only if running via LaunchAgent

What is the problem you are having with rclone?

I am trying to backup a dropbox to a smb share that is locally connected as bread.local
I succeeded in trying to setup rclone remotes for both the dropbox and smb. I also succeeded in running the rcopy command and running a shell script containing the command. However, i am activating that shell script via a Mac LaunchAgent and in that case, the script cant connect to the smb. I already added a generous sleep timer to the script to delay its execution after startup for a while, so that all networks can be mounted correctly. Still, that error occurs.

Run the command 'rclone version' and share the full output of the command.

rclone v1.69.3

  • os/version: darwin 15.5 (64 bit)
  • os/kernel: 24.5.0 (x86_64)
  • os/type: darwin
  • os/arch: amd64
  • go/version: go1.24.3
  • go/linking: dynamic
  • go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

Dropbox / SMB

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone copy -P dropboxRemote:"dropbox Projects" serverRemote:"server Projects"

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[server]
type = smb
host = XXX
user = XXX
pass = XXX

[dropbox]
type = dropbox
token = XXX

A log from the command that you were trying to run with the -vv flag

2025/06/20 16:03:13 DEBUG : smb://user@bread.local:445/server Projects/: Waiting for checks to finish
2025/06/20 16:03:13 DEBUG : smb://user@bread.local:445/server Projects/: Waiting for transfers to finish
2025/06/20 16:03:13 ERROR : Attempt 3/3 failed with 1 errors and: couldn't connect SMB: dial tcp [fff::111:ffff:fe44:8385%en1]:445: connect: no route to host
2025/06/20 16:03:13 INFO  : 
Transferred:   	          0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:      30m0.0s

2025/06/20 16:03:13 DEBUG : 7 go routines active
2025/06/20 16:03:13 INFO  : Dropbox root 'bread Projects': Committing uploads - please wait...
2025/06/20 16:03:13 NOTICE: Failed to copy: couldn't connect SMB: dial tcp [ffff::111:ffff:fe44:8385%en1]:445: connect: no route to host
2025-06-20 16:03:13 - rclone copy encountered an error.

Does it connect when you start this LaunchAgent manually after boot?:

launchctl start your.copy.launchd

If yes then you have to wait for a network.

Have a look at this example for mount:

you can modify it for your command. No need for LaunchAgents.