Cron Daemon Mails Spam

TheBiaatch

Verified User
Joined
Jul 30, 2007
Messages
8
Hi,

Cron Daemon sends me a mail EVERY minute... the message is this:

/bin/sh: /home/admin/: is a directory


How do I stop this?
 
Somewhere you've got a cronjob that's attempting to manipulate /home/admin as if it were a file. Find that cronjob, and either fix it or delete it.

The cronjob is either in the /etc/crontab file (or in a file in the /etc/crontab.d directory if it exists), or in one of the cronjob files in /var/spool/cron.

Note that for cronjobs in the /etc/crontab file or in a file in the /etc/crontab.d directory you can edit the file directly (and then afterwards restart the cron daemon) but for cronjobs in /var/spool/cron you must use the crontab edit command.

Jeff
 
As I wrote, the cronjob is probably in either the /etc/crontab file, which you can edit directly, in one of the files in /etc/crontab.d (if it exists) which you can edit directly, or in one of the files in /var/spool/cron, which you can't edit directly, but for which you have to use the crontab edit command.

You can use any editor you want, including nano, if you know how to use it.

I'm not sure which editor the crontab edit command uses by default because I've changed mine to use the one I want.

You can execute the crontab command to edit a crontab (from any directory):
Code:
# export VISUAL=editorname
crontab -u username -e
where editorname is the name of the editor you want to use, and username is the name of the user owning the crontab you want to edit.

You can read the cronjobs in /var/spool/cron to find where the problem cronjob may exist, but editing that file directly will NOT affect scheduled cronjobs.

Note that after editing any file directly yourself you must restart the cron daemon.

If you're not familiar with this and/or if you don't feel comfortable doing it, then you shouldn't attempt it yourself; many cronjobs are critical to the operation of your system, and you can easily break cron.

Jeff
 
Back
Top