mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 06:37:01 +08:00
install.sh: failed to add to crontab when there's no crontab
This commit is contained in:
parent
e937935a28
commit
c9e2dfa8de
|
@ -197,6 +197,9 @@ install_crontab()
|
|||
{
|
||||
if [[ -x $(command -v crontab) ]]; then
|
||||
fmt_note "installing \"$CRON_JOB\" to crontab ..."
|
||||
if ! crontab -l 1>/dev/null 2>&1; then
|
||||
echo -n | crontab -
|
||||
fi
|
||||
( crontab -l | grep -vxF "${CRON_JOB}" | grep -v "no crontab for"; echo "$CRON_JOB" ) | crontab -
|
||||
else
|
||||
fmt_warning "crontab does not exist. skipping ..."
|
||||
|
|
Loading…
Reference in New Issue
Block a user