Today I got a working backup. So it is in fact the missing network after sleeping.
I did now add a check to wait for a network connection. I will post an update next week with some sample code when I got it working.
Post
Replies
Boosts
Views
Activity
Many thanks for your help.
Just a few minutes ago I thought the same because Remote Desktop and it showed me sleeping for the server…
As a quick solution I added a launch daemon plist which calls caffeinate to prevent sleeping.
I'm eager so see if the backup does run tonight and I will post the result tomorrow.
The networking stack on the Mac should work independently of whether a user is logged in.
I think so, too but I have no clue why it works always when called manually vs. automatically.
It looks like you’re using SwiftNIO for your networking. Are you use Network framework under the covers? That is, are you using NIO Transport Services?
Yes. I use SwiftNIO 2.35.0 for my Mailer class which is based on SwiftSMTP.
But even when there is a SwiftNIO issue the shell call using sshfs to mount a remote volume should work still work…
I wonder if there is a security issue. The deamon process is called as admin user
<key>UserName</key>
<string>admin</string>
<key>GroupName</key>
<string>admin</string>
and this works as expected. I checked this via ProcessInfo().userName debug output.
Edit:
AFAIK I don't use NIOTransportServices although the package is included in projects package list. A source search for NIOTransportServices gave no hit.
StartCalendarInterval like this (for the other days the same):
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Weekday</key>
<integer>0</integer>
<key>Hour</key>
<integer>5</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
Edit: The job is started properly but the log shows the errors above. I assume there is a networking issue in case no user is logged in (GUI or via ssh in Terminal).
It is still no good solution because building for "Any Mac" does prevent a debug run. I need to switch back to "My Mac".
I would prefer a solution wich works for both scenarios…
I could solve this issue. As stated at https://forums.swift.org/t/xcode-12-2-spm-swift-nio-fails-to-build-for-apple-silicon-arm64/42197/22
I had the same issue & realized I was building for "My Mac", and not "Any Mac".. that fixed it & built the packages for both. (Top left of the center portion of the Xcode main screen.. where you pick your scheme)
So building for "Any Mac (Apple Silicon, Intel)" works.
Hedwig is no solution for me. It is outdated and works not with Swift 5.
Swift SMTP package is also useless for me because it does implement a special handling on macOS which does prevent the usage of self signed snakeoil certificates. I don't want to get an official certificate for my in-house server because the cert is just used for TLS-encryption, which works well on Linux or via postfix on macOS.
So I have currently no solution for this problem.