fix crontab
This commit is contained in:
@@ -71,7 +71,7 @@ review_script() {
|
|||||||
|
|
||||||
remove_legacy_cron() {
|
remove_legacy_cron() {
|
||||||
if crontab -l -u root 2>/dev/null | grep -q "update-lxcs-cron.sh"; then
|
if crontab -l -u root 2>/dev/null | grep -q "update-lxcs-cron.sh"; then
|
||||||
(crontab -l -u root 2>/dev/null | grep -v "update-lxcs-cron.sh") | crontab -u root -
|
(crontab -l -u root 2>/dev/null | grep -v "update-lxcs-cron.sh" || true) | crontab -u root -
|
||||||
ok "Removed legacy curl-based cron entry"
|
ok "Removed legacy curl-based cron entry"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ CONF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
(
|
(
|
||||||
crontab -l -u root 2>/dev/null | grep -v "${LOCAL_SCRIPT}"
|
crontab -l -u root 2>/dev/null | grep -v "${LOCAL_SCRIPT}" || true
|
||||||
echo "${CRON_ENTRY}"
|
echo "${CRON_ENTRY}"
|
||||||
) | crontab -u root -
|
) | crontab -u root -
|
||||||
ok "Added cron schedule: Every Sunday at midnight"
|
ok "Added cron schedule: Every Sunday at midnight"
|
||||||
@@ -134,7 +134,7 @@ CONF
|
|||||||
|
|
||||||
remove() {
|
remove() {
|
||||||
if crontab -l -u root 2>/dev/null | grep -q "${LOCAL_SCRIPT}"; then
|
if crontab -l -u root 2>/dev/null | grep -q "${LOCAL_SCRIPT}"; then
|
||||||
(crontab -l -u root 2>/dev/null | grep -v "${LOCAL_SCRIPT}") | crontab -u root -
|
(crontab -l -u root 2>/dev/null | grep -v "${LOCAL_SCRIPT}" || true) | crontab -u root -
|
||||||
ok "Removed cron schedule"
|
ok "Removed cron schedule"
|
||||||
fi
|
fi
|
||||||
remove_legacy_cron
|
remove_legacy_cron
|
||||||
|
|||||||
Reference in New Issue
Block a user