Post

Replies

Boosts

Views

Activity

Launchctl agent errors
I am trying to automate a backup terminal script to mirror some directories to my NAS. The terminal script is working fine, so I want to automate them. The recommended path uses the launchctl agent, which, from the description, should be what I need. However, I have been running into two errors and looking for answers. I am using a M1 Mac mini with 8GB of memory (for reference). First, I get an error 23, which means too many files are open. If I reboot the machine, this error goes away. But why am I getting this message? I can run the script manually without a problem, and the system is running fine. The machine does little, so it should have almost nothing open. The second error, once the 23 is cleared, is error 12, cannot allocate memory. The machine is an 8GB machine but is reporting 3GB free. Again, the script runs fine in the terminal. I suspect the problem is the agent, but I am unsure how to diagnose or resolve these issues. I do not want to reboot the machine to run the backup, and so is the agent running under some system constraints that are too limiting. Can I change those limits for the job and make the recommended process to automate work? Any suggestions would be appreciated.
2
0
632
Jan ’24
Applying multiple filters to struct in List
I am trying to apply multiple filters to a struct in a List. The following code is the main search control filter: @State private var includeInactive : Bool = false @State private var searchText: String = "" @State private var isEditing = false List(clientData.Clients.filter({                 searchText.isEmpty ? true : $0.fullname.lowercased().contains(searchText.lowercased())                  }) ) { ClientLimited in The code for the search filter works fine. The question is, how do I add query elements. I want to also filter this list on an element called inactive from the includeInactive Bool, which is set by a toggle. I can change the filter as follows: @State private var includeInactive : Bool = false List(clientData.Clients.filter({                 includeInactive == true ? true : $0.inactive == false                  }) ) { ClientLimited in This filters the data correctly for the inactive control. How do you add both of these into one filter?
1
0
888
Feb ’22