0

My system is centos 7.4.
After crontab -e,I add

MAILTO=root
30 4 * * * root /usr/sbin/aide --check

Then I receive email as below:

From: "(Cron Daemon)" <root@mail.mydomain.com>
To: root@mail.mydomain.com
Subject: Cron <root@myserver> root /usr/sbin/aide --check
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
Precedence: bulk
X-Cron-Env: <XDG_SESSION_ID=37>
X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/0>
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Message-Id: <20190300432001.5EC7524C51@mail.mydomain.com>
Date: Fri,  1 Mar 2019 04:32:01

/bin/sh: root: command not found

I checked /var/log/aide/aide.log is empty, there's no any information in messages and secure.It seemed my crontab script is somewhere wrong.
I just want to receive aide --check report,where is the problem?

rubo77
  • 19,527
  • 31
  • 134
  • 226
kittygirl
  • 2,255
  • 5
  • 24
  • 52

1 Answers1

2

The command you must exec is this:

MAILTO=root
30 4 * * * /usr/sbin/aide --check

Cron interpret root as command. The original cron records differ from those in cron.daily and so on directories because the standard cron records are per user, not per specific time

Romeo Ninov
  • 6,538
  • 1
  • 22
  • 31