[SOLVED] - Every cron entry twice
- warron.french
- Posts: 616
- Joined: 2014/03/27 20:21:58
[SOLVED] - Every cron entry twice
Hello, in my /var/log/cron file for the past 4 weeks, which is the limit for as far back as I can go due to logrotate I have every single line duplicated in the log file twice.
I execute several scripts out of /var/spool/cron/root and I want to keep it that way.
As I mentioned every single thing that is executed via crond regardless of /etc/cron.d, /etc/cron.daily, /etc/cron.hourly, /etc/cron.weekly - whatever, it is all listed for every entry twice.
Any ideas?
I execute several scripts out of /var/spool/cron/root and I want to keep it that way.
As I mentioned every single thing that is executed via crond regardless of /etc/cron.d, /etc/cron.daily, /etc/cron.hourly, /etc/cron.weekly - whatever, it is all listed for every entry twice.
Any ideas?
Last edited by warron.french on 2021/04/13 14:49:18, edited 1 time in total.
Thanks,
War
War
Re: Every cron entry twice
How many lines of output do you get from
ps fax | grep [c]rond
ps fax | grep [c]rond
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Every cron entry twice
Are the cron entries running twice, or just being logged twice?warron.french wrote: ↑2021/04/08 13:42:30Hello, in my /var/log/cron file for the past 4 weeks, which is the limit for as far back as I can go due to logrotate I have every single line duplicated in the log file twice.
I execute several scripts out of /var/spool/cron/root and I want to keep it that way.
As I mentioned every single thing that is executed via crond regardless of /etc/cron.d, /etc/cron.daily, /etc/cron.hourly, /etc/cron.weekly - whatever, it is all listed for every entry twice.
Any ideas?
I would not be too hard to write a simple script to append the date to a file, which cron runs every 10 minutes. Then you can see by the timestamps written to the file whether it actually ran twice or not.
- warron.french
- Posts: 616
- Joined: 2014/03/27 20:21:58
Re: Every cron entry twice
I see a total of two, one of them for /us/sbin/crond -n, and the other for egrep.
Thanks,
War
War
- warron.french
- Posts: 616
- Joined: 2014/03/27 20:21:58
Re: Every cron entry twice
The cron entries do not appear to be running twice as I checked on of my cron'd scripts and saw that it is only being executed once every minute; which my script does something precisely like what you are describing as a test anyway.Whoever wrote: ↑2021/04/09 03:02:48Are the cron entries running twice, or just being logged twice?warron.french wrote: ↑2021/04/08 13:42:30Hello, in my /var/log/cron file for the past 4 weeks, which is the limit for as far back as I can go due to logrotate I have every single line duplicated in the log file twice.
I execute several scripts out of /var/spool/cron/root and I want to keep it that way.
As I mentioned every single thing that is executed via crond regardless of /etc/cron.d, /etc/cron.daily, /etc/cron.hourly, /etc/cron.weekly - whatever, it is all listed for every entry twice.
Any ideas?
I would not be too hard to write a simple script to append the date to a file, which cron runs every 10 minutes. Then you can see by the timestamps written to the file whether it actually ran twice or not.
I just see entries like this, but for every entry regardless of source:
Code: Select all
Apr 12 07:51:01 servername CROND[28389]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Apr 12 07:51:01 servername CROND[28389]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Thanks,
War
War
Re: Every cron entry twice
Then you didn't cut and paste my command properly. The reason for "grep [c]rond" is to stop the grep from appearing in the output.I see a total of two, one of them for /us/sbin/crond -n, and the other for egrep.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
- warron.french
- Posts: 616
- Joined: 2014/03/27 20:21:58
Re: Every cron entry twice
@Trevor, sorry, you are correct. I used egrep instead of grep.
Just one line of output now, simply the /usr/sbin/crond -n.
Just one line of output now, simply the /usr/sbin/crond -n.
Thanks,
War
War
Re: Every cron entry twice
What's in your /etc/rsyslog.conf?
- warron.french
- Posts: 616
- Joined: 2014/03/27 20:21:58
Re: Every cron entry twice
@Whoever, are you referring to the rules that forward data to /var/log/cron or are you referring to the lines at the top that define the IM rules?
Thanks,
War
War
Re: Every cron entry twice
I suggest you post everything that isn't a comment.