我在Tahoe中针对cron的文件访问解决方案

2作者: noduerme5 天前原帖
假设你想在一个定时任务(cron job)中访问一个文件夹。也许它在另一个驱动器上,或者是一个Dropbox文件夹。哦不,你不能!不允许!这不是权限问题,而是全盘访问的保管链! 你可能会说,没问题,我会在这个充满系统偏好的便捷图形界面中给定时任务(cron)提供全盘访问权限,那个窗口角落圆润得很。简而言之,你无法给定时任务(cron)提供全盘访问权限。你可以尝试一次又一次,但它就是不行。你无法给许多其他极其有用的二进制文件提供全盘访问权限,即使你希望它们能够拥有。为了上帝的名义,你甚至无法给sshd提供全盘访问权限。你能做的就是找到那个隐藏的设置:在“系统偏好设置”中依次选择“共享” > “远程登录” > (信息按钮) > “允许远程用户全盘访问”。这非常讽刺,因为它允许<i>任何通过SSH连接的人获得全盘访问权限</i>。 呵呵呵。 今晚我解决了苹果公司创建的那个愚蠢系统,它阻止我通过定时任务(cron job)访问我自己的机器:更改那个设置,现在只需让你的定时任务通过SSH连接到本地(localhost),一切就能完美运行了 ;)
查看原文
Suppose you want to access a folder in a cron job. Maybe it&#x27;s on another drive, maybe it&#x27;s a Dropbox folder. Oh no, you can&#x27;t! Not allowed! It&#x27;s not a permissions issue, it&#x27;s the chain of custody for full disk access!<p>No problem you say, I&#x27;ll go and give cron full disk access in this handy GUI full of system preferences with the nice ultra-round window corners. TL;DR, you can&#x27;t give full disk access to cron. You can try, over and over, but it will not work. You can&#x27;t give full disk access to lots of other extremely useful binaries that should be allowed to have it if you want them to. You can&#x27;t even give it to sshd for the love of God. About all you can do is find the buried preference in General &gt; Sharing &gt; Remote Login &gt; (info button) &gt; &quot;Allow Full Disk Access for Remote Users&quot;. Which, rather ironically, lets <i>anyone who connects via SSH get full disk access</i>.<p>Heheheh.<p>Tonight I fixed the inane system Apple created that prevents me from accessing my own machine with cron jobs: Change that setting, now just have your cron jobs ssh into localhost and everything works perfectly ;)