记一次MacOS Cron的环境变量debug经历
date
May 20, 2022
slug
tip-mac-cron-environment-variable-error
status
Published
summary
小技巧
tags
tip
type
Post
URL
Problem & Summary
cron当中可以这样设env var,所有的cron job都可以引用这个var

问题是,bar 这个字符串当中不能再次被解析,比如FOO=$HOME/xxx 或者 FOO=~/xxx ;这里面的$HOME和~ 是无法被解析的;相当于\$HOME和 \~来对待
Solution
* * * * * export QH13=~/webdav_remote_r; ls -l $QH13

另外,mac当中看cron的log只能用 mail
