Skip to content

Commit

Permalink
fix autoprotect cronjob set path & less verbose cron runs
Browse files Browse the repository at this point in the history
  • Loading branch information
centminmod committed Jun 8, 2016
1 parent ac17c0e commit 4cd7763
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions inc/cpcheck.inc
Original file line number Diff line number Diff line change
Expand Up @@ -779,9 +779,10 @@ imagick_fixes() {
}

apache_protect() {
if [[ -z "$(crontab -l 2>&1 | grep 'autoprotect.sh')" && -f "${SCRIPT_DIR}/tools/autoprotect.sh" ]]; then
if [[ -z "$(crontab -l 2>&1 | grep '\/usr\/local\/src\/centminmod\/tools\/autoprotect.sh')" && -f "/usr/local/src/centminmod/tools/autoprotect.sh" ]]; then
crontab -l > cronjoblist
echo "11 */23 * * * ${SCRIPT_DIR}/tools/autoprotect.sh" >> cronjoblist
sed -i '/autoprotect.sh/d' cronjoblist
echo "11 */23 * * * /usr/local/src/centminmod/tools/autoprotect.sh 2>/dev/null" >> cronjoblist
crontab cronjoblist
rm -rf cronjoblist
crontab -l
Expand Down
2 changes: 1 addition & 1 deletion tools/cminfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if [[ -z "$(crontab -l 2>&1 | grep cminfo_updater)" ]]; then
crontab -l > cronjoblist
mkdir -p /etc/centminmod/cronjobs
cp cronjoblist /etc/centminmod/cronjobs/cronjoblist-before-cminfo-setup.txt
echo "*/4 * * * * /usr/bin/cminfo_updater" >> cronjoblist
echo "*/4 * * * * /usr/bin/cminfo_updater 2>/dev/null" >> cronjoblist
cp cronjoblist /etc/centminmod/cronjobs/cronjoblist-after-cminfo-setup.txt
crontab cronjoblist
rm -rf cronjoblist
Expand Down

0 comments on commit 4cd7763

Please sign in to comment.