简体   繁体   中英

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

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

but into a crontab it doesn't work

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

as suggested by Jonathan Leffler just enter in the path /sbin

part of ~/.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

~/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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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