简体   繁体   English

命令挂载到 crontab 在 macOS 中不起作用

[英]command mount into crontab doesn't work in macOS

I set a crontab for mounting a remote volume, if I run the following command it works我设置了一个用于挂载远程卷的 crontab,如果我运行以下命令,它就可以工作

mount -t smbfs //<__username__>:<__password__>@<__remote_host>/<__remote_folder__> <myFolder>

but into a crontab it doesn't work但进入 crontab 它不起作用

30 13 * * * /path/to/my/script

as suggested by Jonathan Leffler just enter in the path /sbin正如Jonathan Leffler所建议的,只需输入路径/sbin

part of ~/.bash_profile ~/.bash_profile的一部分

export PATH="/usr/local/bin:/usr/bin:/bin:/sbin"

I had all sorts of problems with crontab on Big Sur until I cleaned out在我清理干净之前,我在 Big Sur 上的 crontab 遇到了各种各样的问题

~/Library/LaunchAgents
/Library/LaunchAgents
/Library/LaunchDaemons
/Library/StartupItems

for an apparently unrelated problem.对于一个明显不相关的问题。 These were repopulated after a reboot, except the last, which you have to set up yourself.这些在重新启动后重新填充,除了最后一个,您必须自己设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM