Lima and backup scripts

How would you let a bash backup script end the Lima service after the backup file is fully synced? I could poll lime ls <path> until the L flag appears, but isn't there an easier way? Can the Lima app return some error code that reflects the L flag? I think the bash return variable $? of lime ls <file> could somehow be mapped with the Lime file flags.

Or may be change lima pending causing it to exit as soon as the pending queue is empty? Or lime pending <directory or file path> the optional parameter allowing to show pending a single file or a particular directory. Again it would return when the file or directory is no more pending.

I noticed however, that for lime pending <directory or file path> to work like I described, first a bug should be fixed. I noticed there is a delay lima pending remaining empty until Lima service actually starts uploading. In that delay period you can do lima ls <file> and see the missing L flag but you won't see the file yet in lima pending. I would fix this inconsistency; lime pending should show all files without L flag straight away. If fixing this becomes too complicated than at least the feature should be renamed to lima syncing; Or may be there is a way to fully eliminate the delay?