Can someone tell me why this doesn't work please?
(trash_file is just a dummy text file I made)
I've been banging my head up against the wall all day. I can run that exact commandline from the bash shell (as a normal user), from the csh (as root), and from the sh shell (as root), and it runs fine in all three cases. What's different about when crontab runs it?
Before you say something about the environment, I also copied the exact environment (line by line) from each of the three situations I described above to the crontab environment, and I also made a wrapper Perl script and changed the environment there as well to exactly match. I've even tried adding "@localhost" and "@localhost.localdomain" after the recipient, and changed recipient to just a normal user. Nothing has worked.
Any ideas? I really need to be able to mail things out as root. (This is because I need root privs to run some networking events, but I need to mail things out in case of trouble.)
Thanks,
TheGuyGuy
Code:
# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD: src/etc/crontab,v 1.32 2002/11/22 16:13:39 tom Exp $
#
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour mday month wday who command
#
*/1 * * * * root /usr/bin/mail -s 'hellooo' root < /home/curry/scripts/trash_file
#
I've been banging my head up against the wall all day. I can run that exact commandline from the bash shell (as a normal user), from the csh (as root), and from the sh shell (as root), and it runs fine in all three cases. What's different about when crontab runs it?
Before you say something about the environment, I also copied the exact environment (line by line) from each of the three situations I described above to the crontab environment, and I also made a wrapper Perl script and changed the environment there as well to exactly match. I've even tried adding "@localhost" and "@localhost.localdomain" after the recipient, and changed recipient to just a normal user. Nothing has worked.
Any ideas? I really need to be able to mail things out as root. (This is because I need root privs to run some networking events, but I need to mail things out in case of trouble.)
Thanks,
TheGuyGuy