For restoring a backup to a Linux filesystem, libimobiledevice requires the iOS device to be present, so you will probably want ideviceunback instead, which doesn't have this issue:
There doesn’t have to run anything special on the IPhone.
In the early days iTunes could make backups on the local pc when the iPhone was connected via usb. Later on apple extended this to wifi: so if you had an iTunes running in your wifi and the iPhone joined a backup was done at the iTunes side.
I‘m not sure if this feature is still there, but I would have found this very useful if it would have been possible with the computer that is running anyways (as in the pi).
Those are extremeley limited and I don't think it's possible to run any kind of interesting scripts locally.
I did look at it when I still had an iPhone and it's one of those "almost usable but fundamentally broken" things that are par for iOS. It works well enough that I could spend a weekend or two making stuff that almost works with it.
Jailbroken devices have this ability. At one point I had rclone daemon syncing iCloud files to Seafile through the terminal. You can also run scripts through Shortcuts by local ssh