help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how bash run by crontab is different from login bash shell?


From: Peng Yu
Subject: Re: how bash run by crontab is different from login bash shell?
Date: Thu, 10 Sep 2020 14:55:57 -0500

The things that might serve as a solution is "System Preferences >
Security & Privacy > Privacy > Full Disk Access > "add your app such
as svnX". But I tried to set crontab and bash in Full Disk Access. It
doesn't solve the problem. So that is not the solution.

Does anybody who has Mac OS X 15.16 encounter the same problem? I can
not understand why bash can run correct but `enable` can not run.

On 9/10/20, Jesse Hathaway <jesse@mbuki-mvuki.org> wrote:
> I don't run Mac OS, but this part of your error message:
>
> "file system sandbox blocked open() of
> '/Users/xxx/Downloads/bash-5.0/examples/loadables/realpath'"
> https://stackoverflow.com/questions/44627957/mac-os-file-system-sandbox-blocked-open
>
> seems to indicate that Mac OS is purposely blocking access for the cronjob,
> more info on this stackoverflow post:
>
> https://stackoverflow.com/questions/44627957/mac-os-file-system-sandbox-blocked-open
>
>
> On Wed, Sep 9, 2020 at 8:05 PM Peng Yu <pengyu.ut@gmail.com> wrote:
>>
>> Hi,
>>
>> I have the following line in crontab.
>>
>> * * * * * LANG=en_US.UTF-8 /usr/local/bin/bash -c 'builtin enable -f
>> /Users/xxx/Downloads/bash-5.0/examples/loadables/realpath realpath'
>> >/tmp/crontab_stdout_realpath.log 2>/tmp/crontab_stderr_realpath.log
>>
>> But it prints the following error.
>>
>> $ cat /tmp/crontab_stderr_realpath.log
>> /usr/local/bin/bash: line 0: enable: cannot open shared object
>> /Users/xxx/Downloads/bash-5.0/examples/loadables/realpath:
>> dlopen(/Users/xxx/Downloads/bash-5.0/examples/loadables/realpath, 1):
>> no suitable image found.  Did find:
>>         file system sandbox blocked open() of
>> '/Users/xxx/Downloads/bash-5.0/examples/loadables/realpath'
>>
>> But the following command run in the login shell works fine. Does
>> anybody know what is the difference between bash run by crontab and
>> the login shell? How the error is caused? The OS is Mac OS Catalina
>> 10.15.6. Thanks.
>>
>> $ builtin enable -f
>> /Users/xxx/Downloads/bash-5.0/examples/loadables/realpath realpath
>>
>> --
>> Regards,
>> Peng
>>
>


-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]