Trigger sync with Tasker

With the application Orglzy I was able to use Tasker to trigger a sync with the “Run shell” command. Is this possible with Joplin as well?

The command I was running with Orgzly was:

am startservice --user 0 -a com.orgzly.intent.action.SYNC_START com.orgzly/com.orgzly.android.sync.SyncService

The reason I would like to do this, is because Joplin doesn’t sync in the background and then I sometimes miss a notification.

To sync using the command line you can use joplin sync && joplin e2ee decrypt

This doesn’t work with Android app.
I reckon I could setup a hack with Termux, Joplin Terminal and Tasker and let the Android app sync from the file system but it would be nicer if there were a less complex setup.

I think we should find a way to allow people to sync in the background. But iirc there was a klimitation in react-native or something that blocked us from doing this.
But I would rather see a flag in settings (or use the Android native flag) to allow syncing in the background.

I agree that this would be the better solution but I could live with this hack for the moment :).
At least it would be better than to miss notifications for tasks.

I think I found another way how it could work. I’m going to open Joplin with Tasker every hour this way it might trigger the sync.