Why do I get a deadlock warning for a simple job on a cloud file?
1
vote
0
answers
246
views
I have a file that sits on a Cloud directory managed by a cloud storage service that uses the Apple FileProvider API. No, this is not iCloud, but this is apparently the same API framework in use.
The desire is that since the API doesn't allow me to pin/favorite a file to prevent it from swapping out to the cloud, I've set up a simple
cron
job that once-an-hour will do this:
cat /Users/myusername/Library/CloudStorage/CloudDrive-Documents/neverswap.txt >/dev/null
I figure that as long as I'm regularly accessing the file, it'll never swap out, right? Unfortunately, it seems like I regularly find this error being spit out by cron:
cat: /Users/myusername/Library/CloudStorage/CloudDrive-Documents/neverswap.txt: Resource deadlock avoided
So my question is:
1. Why is this simple job sometimes resulting in a deadlock? And a deadlock of *what*?
1. I suspect UNIX tools like cat
don't communicate with the FileProvider API and only the Finder seems to know how to trigger things, is this correct?
1. Is there a better way to do this?
thanks
**UPDATE 2024-10-16:** While I haven't found an answer to the above, I will point out that my solution to the cron job was to replace it with a simple Automator script that is two steps: 1/"Run Shell Script" which simply echo
's the name of the file to step 2/"Copy Finder Items" which takes that file and copies it to /tmp
. I then have cron run that app instead of the simple shell command.
Asked by bjb
(2664 rep)
Feb 13, 2024, 05:54 PM
Last activity: Oct 16, 2024, 12:45 PM
Last activity: Oct 16, 2024, 12:45 PM