Crontab没有运行我的脚本。卡塔琳娜 [英] Crontab is not running my script. Catalina

查看:102
本文介绍了Crontab没有运行我的脚本。卡塔琳娜的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用crontab并遇到一些问题。我已经阅读了一些有关如何在macOS上使用它的文章,但仍然无法正常工作。

I just have started to use crontab and have some problems with it. I have already read some posts about how to use it on macOS, but it still not working.

因此,我的任务非常简单:
我写了crontab -e,然后将其编辑为
* / 1 * * * * cliclick -w 1 m:3,3 -例如,这意味着每重复1分钟
一切都没有改变。
但是,当我从终端仅使用此命令时,一切正常。

So, my task is very easy: I write crontab -e, then edit it to */1 * * * * cliclick -w 1 m:3,3 (for example) - which mean repeat every 1 min. And nothing has changed. But, when I use just this command from terminal everything is ok.

我已经尝试创建script.sh文件,并且情况相同:

I have already try to create a script.sh file, and the same situation: from hand-command it works, and from crontab isn't.

顺便说一句,如果我使用简单的命令,例如echo,它不是有效的。

By the way, if I use simple command, for example echo it isn't working too.

也许我做错了,请帮帮我。

Maybe, I do something wrong, please help me.

PS:完全访问磁盘crontab有。

PS: Full access to disk crontab has.

谢谢!

推荐答案

我的问题是,cron无法访问磁盘,因此无法运行我的脚本。我必须授予 / usr / sbin / cron

My Problem was, that cron had no access to the Disk, so it couldn't run my script. I had to give Full Disk Access for /usr/sbin/cron

的完全磁盘访问权限,请参阅此博客文章: https://blog.bejarano.io/fixing-cron-jobs-in-mojave/

See this blog post: https://blog.bejarano.io/fixing-cron-jobs-in-mojave/

这篇关于Crontab没有运行我的脚本。卡塔琳娜的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆