挂载加密稀疏包的 Cron 作业
我可以在终端中运行以下命令来安装加密的稀疏包,其中捆绑包密码存储在钥匙串中。
hdiutil attach '/Volumes/Backup/Mac1.sparsebundle'
我想让该命令按计划运行,因此我使用 CronniX 使用该命令创建一个 cron 作业。但是,当它在预定时间运行时,什么也没有发生。当我在终端中检查 cron 守护进程邮件时,它显示以下内容:
hdiutil: attach failed - Authentication error
我假设它无法从钥匙串读取密码?我不知道。希望有人能够阐明一些事情,或者为我指出正确的方向。
谢谢
I can run the following command in terminal to mount an encrypted sparsebundle where the bundle password is stored in the keychain.
hdiutil attach '/Volumes/Backup/Mac1.sparsebundle'
I would like to have that command run on a schedule, so I'm using CronniX to create a cron job with that command. But, when it runs at the scheduled time, nothing happens. When I check the cron daemon mail in terminal, it says the following:
hdiutil: attach failed - Authentication error
I'm assuming that it isn't able to read the password from keychain? I don't know. Hoping somebody can shed some light on things, or point me in the right direction.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
hdiutil 取决于一些环境变量。检查这个(环境部分)。因此,当您从终端运行和从 cron 运行时,环境可能会有所不同。根据错误,我认为这是由于缺少 com_apple_diskimages_insecureHTTP 造成的。然而,相同的效果将添加 -insecurehttp 到参数或使用 -cacert/-capath 指定 SSL 证书。
hdiutil depends on some environment variables. Check this (ENVIRONMENT section). So, probably the environment is different when you run from terminal and from cron. According to error, I think this is due to absence of com_apple_diskimages_insecureHTTP. However the same effect will give adding -insecurehttp to the arguments or specify SSL certificate with -cacert/-capath.