Thank you. I backed away from my attempted changes to the crontab which came with the system, when I realized I would have to daily check the output from avg.sh in which case I might as well run the script myself,
sudo avg.sh
. The first command of the script,
avgupdate
only executes with root privileges. That’s why I attempted, maybe erroneously, to add execution of my script to the “general” system crontab. now my changes are commented out and now I plan to remove my, now irrelevant comment lines as well:
pe1800@linux-gkd7:~> sudo crontab -l
root's password:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.1FMiqx installed on Wed May 29 10:02:23 2013)
# (Cronie version 4.2)
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
# :/home/pe1800/bin
MAILTO=root
#
# check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly
#
-*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
#
# update AVG virus database, scan /pe1800 and generate stats
#
# 7 11 * * * root /home/pe1800/bin/avg.sh
**You have new mail in /var/spool/mail/pe1800**
pe1800@linux-gkd7:~>
But I still keep getting that message:
** /bin/sh: root: command not found**
which is a mystery to me.
I also wonder whether the above quoted crontab is actually still executing. I have added a text file with some notes about this crontab issue to my file system. If I do a
locate crontabproblems
tomorrow, after the daily update of the locate database, I should know whether the crontab is working or not, right?
I look forward to your expert comment. Cheers, pe1800
Because of the marked line I guess.
As has been mentioned before, that format is invalid for the crontab you edit with “crontab -e”.
So comment out this line as well or remove it completely…
Yes, that cleared it up. Thank you. You made me aware that
/etc/crontab is not the same as crontab -l or -e
which, although I have noticed that /etc/crontab does not change, which has confused me all along, I cannot get my head around but I do of course accept what you told me, it solved the issue!
As I already mentioned (and others as well), crontab -l or -e uses files in /var/spool/cron/tabs/. Each user has a personal crontab there, even root. Those get called by cron on behalf of the respective user.
> But I still keep getting that message:
> Code:
> --------------------
> * /bin/sh: root: command not found*
> --------------------
> which is a mystery to me.
I explained that in detail on my previous post.
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)
On 2013-05-31 23:06, pe1800 wrote:
>
> Yes, that cleared it up. Thank you. You made me aware that
> Code:
> --------------------
> /etc/crontab is not the same as crontab -l or -e
> --------------------
> which, although I have noticed that /etc/crontab does not change, which
> has confused me all along, I cannot get my head around but I do of
> course accept what you told me, it solved the issue!
I also have explained that in detail, perhaps even twice!
I might as well not bother to write, if you don’t make an effort :-/
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)