mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 13:56:59 +08:00
fix(install.sh): crontab fails on a new server
This commit is contained in:
parent
3d4a264a30
commit
019781f9ee
|
@ -203,9 +203,10 @@ install_crontab()
|
||||||
if [[ -x $(command -v crontab) ]]; then
|
if [[ -x $(command -v crontab) ]]; then
|
||||||
fmt_note "installing \"$CRON_JOB\" to crontab ..."
|
fmt_note "installing \"$CRON_JOB\" to crontab ..."
|
||||||
if ! crontab -l 1>/dev/null 2>&1; then
|
if ! crontab -l 1>/dev/null 2>&1; then
|
||||||
echo -n | crontab -
|
echo "$CRON_JOB" | crontab -
|
||||||
fi
|
else
|
||||||
( crontab -l | grep -vxF "${CRON_JOB}" | grep -v "no crontab for"; echo "$CRON_JOB" ) | crontab -
|
( crontab -l | grep -vxF "${CRON_JOB}" | grep -v "no crontab for"; echo "$CRON_JOB" ) | crontab -
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
fmt_warning "crontab does not exist. skipping ..."
|
fmt_warning "crontab does not exist. skipping ..."
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user