我在 Tahoe 中使用 cron 访问文件的解决方法
2 分•作者: noduerme•3 个月前
假设你希望在 cron 作业中访问一个文件夹。也许它位于另一个驱动器上,也许它是一个 Dropbox 文件夹。哦,不,你不能!不允许!这并非权限问题,而是为了保障对磁盘的完全访问权限!
你可能会说,没问题,我可以在这个方便的、带有漂亮超圆角窗口的系统偏好设置 GUI 中,给 cron 授予完全磁盘访问权限。 简而言之,你无法给 cron 授予完全磁盘访问权限。 你可以反复尝试,但它不会起作用。 你无法给许多其他非常有用的二进制文件授予完全磁盘访问权限,而如果你希望它们工作,就应该允许它们拥有此权限。 甚至,出于对上帝的爱,你都无法给 sshd 授予此权限。 你几乎唯一能做的,就是在“通用”>“共享”>“远程登录”>(信息按钮)>“允许远程用户完全磁盘访问”中找到隐藏的偏好设置。 具有讽刺意味的是,这允许<i>任何通过 SSH 连接的人获得完全磁盘访问权限</i>。
嘿嘿嘿。
今晚,我修复了苹果公司创建的这个荒谬的系统,它阻止我通过 cron 作业访问自己的机器:更改该设置,现在只需让你的 cron 作业通过 ssh 连接到 localhost,一切就能完美运行 ;)
查看原文
Suppose you want to access a folder in a cron job. Maybe it's on another drive, maybe it's a Dropbox folder. Oh no, you can't! Not allowed! It's not a permissions issue, it's the chain of custody for full disk access!<p>No problem you say, I'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't give full disk access to cron. You can try, over and over, but it will not work. You can'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't even give it to sshd for the love of God. About all you can do is find the buried preference in General > Sharing > Remote Login > (info button) > "Allow Full Disk Access for Remote Users". 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 ;)