MRatWork Forum by Mustafa Ramadhan
Sawo Project - Kloxo-MR Discussions => Kloxo-MR Technical Helps => Topic started by: rsakhale on 2017-08-20, 17:05:08
-
No idea, this has been happening since couple of weeks now getting emails about failure in execution of cron.daily files. Earlier I fixed logrotate from post available on this forum, but now getting failure in spamdyke file. Tried updating the same but still facing the same error issue.
Getting error message as below
/etc/cron.daily/spamdyke:
/usr/bin/find: missing argument to `-exec'
(standard_in) 1: illegal character: ^M
/usr/bin/find: invalid argument `-exec' to `-mmin'
My current spamdyke file
cat spamdyke
#!/bin/sh
# Delete empty files (older than one week)
/usr/bin/find /var/qmail/spamdyke/greylist/ -type f -mmin +10080 -size 0 -exec rm -f {} ;
if [ -f /usr/bin/bc ] ; then
# If installed, it can automatically be determined
GRAYLIST_MAX_SECS=`grep 'graylist-max-secs' /etc/spamdyke.conf | cut -d = -f 2`
GRAYLIST_MAX_SECS=`echo "scale=0 ; $GRAYLIST_MAX_SECS / 60" | bc -l`
else
# Note: should work with graylist-max-secs / 60 / etc / spamdyke.conf identical
# older than 30240 minutes (= 3 weeks)
GRAYLIST_MAX_SECS=30240
fi
# Delete outdated posts
/usr/bin/find /var/qmail/spamdyke/greylist/ -type f -mmin +$GRAYLIST_MAX_SECS -exec rm -f {} ;
sh /script/sysinfo
A. Control Panel:
- Kloxo-MR: 7.0.0.c-2017081502
- Web: hiawatha-10.6.0-f.1.mr.el6.x86_64
- PHP: php56s - 5.6.31-1.ius.centos6 (fpm mode)
B. Plateform:
- OS: CentOS release 6.9 (Final) x86_64
- Hostname: pharmaindigital.com
C. Services:
1. MySQL: MariaDB-server-10.0.32-1.el6.x86_64
2. PHP:
- Installed:
- Branch: php70w-cli-7.0.21-1.w6.x86_64
- Multiple:
* php56m - 5.6.31-1.ius.centos6
* php70m - 7.0.21-1.ius.centos6
* php71m - 7.1.7-1.ius.centos6
- Used: php70m-fpm
- Multiple: enable
3. Web Used: apache
- Hiawatha: hiawatha-10.6.0-f.1.mr.el6.x86_64
- Lighttpd: lighttpd-1.4.45-1.el6.x86_64
- Nginx: nginx-1.13.4-1.el6.ngx.x86_64
- Apache: httpd24u-2.4.27-1.ius.centos6.x86_64
- PHP Type: php-fpm_worker
- Secondary PHP: off
4. WebCache: none
- ATS: --uninstalled--
- Squid: --uninstalled--
- Varnish: --uninstalled--
5. Dns: bind
- Bind: bind-9.9.9-1.mr.el6.x86_64
- DJBDns: djbdns-1.05-17.4.mr.el6.x86_64
- NSD: nsd-4.1.16-1.el6.x86_64
- PowerDNS: pdns-4.0.3-1.el6.MIND.x86_64
- Yadifa: yadifa-2.2.5-1.mr.el6.x86_64
6. Mail: qmail-toaster-1.03-1.3.57.mr.el6.x86_64
- pop3/imap4: courier-imap-toaster-4.1.2-1.3.20.mr.el6.x86_64
- smtp: qmail-toaster-1.03-1.3.57.mr.el6.x86_64
- spam: bogofilter-1.2.4-1.el6.x86_64
7. FTP: pure-ftpd
- pure-ftpd: pure-ftpd-1.0.37-1.mr.el6.x86_64
8. Stats: webalizer
- webalizer: webalizer-2.23_08-1.mr.el6.x86_64
D. Memory:
total used free shared buffers cached
Mem: 3831 2120 1711 23 254 915
-/+ buffers/cache: 950 2880
Swap: 3967 341 3626
E. Disk Space:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg-root 54G 11G 41G 22% /
*** Process Time: 00:00:00:29.29721 (dd:hh:mm:ss:xxxxxx) ***
* Note: run 'sh /script/sysinfo -y' if you want run 'fix-service-list' also
(importance after Kloxo-MR update)
-
Go to 'admin > mail server setting > spamdyke > click update'
-
Done, is there any way to quickly test if this is fixed?
-
If you run '/etc/cron.daily/spamdyke' and then doesn't see message and it's mean work perfectly.
-
Still getting the same error message as below
/usr/bin/find: missing argument to `-exec'
(standard_in) 1: illegal character: ^M
/usr/bin/find: invalid argument `-exec' to `-mmin'
-
Inform here 'cat /etc/spamdyke.conf; cat /usr/local/lxlabs/kloxo/file/template/spamdyke.conf'.
-
#Plesk-Addon
log-level=info
idle-timeout-secs=180
qmail-rcpthosts-file=/var/qmail/control/rcpthosts
qmail-morercpthosts-cdb=/var/qmail/control/morercpthosts.cdb
tls-certificate-file=/var/qmail/control/servercert.pem
#AUTH FROM xinetd-conf
smtp-auth-command=/var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /bin/true
smtp-auth-level=ondemand-encrypted
graylist-level=none
graylist-dir=/var/qmail/spamdyke/greylist
#GREYLIST MINIMUM=5 Min
graylist-min-secs=300
#GREYLIST MAX=3 Months
graylist-max-secs=1814400
sender-blacklist-file=/var/qmail/spamdyke/blacklist_senders
recipient-blacklist-file=/var/qmail/spamdyke/blacklist_recipients
ip-in-rdns-keyword-blacklist-file=/var/qmail/spamdyke/blacklist_keywords
ip-blacklist-file=/var/qmail/spamdyke/blacklist_ip
rdns-whitelist-file=/var/qmail/spamdyke/whitelist_rdns
ip-whitelist-file=/var/qmail/spamdyke/whitelist_ip
sender-whitelist-file=/var/qmail/spamdyke/whitelist_senders
greeting-delay-secs=1
max-recipients=30
header-blacklist-file=/var/qmail/spamdyke/blacklist_headers
#RBL BLOCKLISTS
dns-blacklist-entry=zen.spamhaus.org
dns-blacklist-entry=bl.spamcop.net
dns-blacklist-entry=bogons.cymru.com
dns-blacklist-entry=dnsbl-0.uceprotect.net
dns-blacklist-entry=dnsbl-1.uceprotect.net
dns-blacklist-entry=dnsbl-2.uceprotect.net
dns-blacklist-entry=dnsbl-3.uceprotect.net
dns-blacklist-entry=list.dsbl.org
reject-sender=no-mx
reject-empty-rdns
#reject-ip-in-cc-rdns
reject-unresolvable-rdns
#MySQL-Logging:
#config-mysql-database=spamdyke
#config-mysql-username=spamdyke
#config-mysql-password=spamdyke
#Plesk-Addon
log-level=info
idle-timeout-secs=180
qmail-rcpthosts-file=/var/qmail/control/rcpthosts
qmail-morercpthosts-cdb=/var/qmail/control/morercpthosts.cdb
tls-certificate-file=/var/qmail/control/servercert.pem
#AUTH FROM xinetd-conf
smtp-auth-command=/var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /bin/true
smtp-auth-level=ondemand-encrypted
%lx_graylist_level%
graylist-dir=/var/qmail/spamdyke/greylist
#GREYLIST MINIMUM=5 Min
%lx_graylist_min_secs%
#GREYLIST MAX=3 Months
%lx_graylist_max_secs%
sender-blacklist-file=/var/qmail/spamdyke/blacklist_senders
recipient-blacklist-file=/var/qmail/spamdyke/blacklist_recipients
ip-in-rdns-keyword-blacklist-file=/var/qmail/spamdyke/blacklist_keywords
ip-blacklist-file=/var/qmail/spamdyke/blacklist_ip
rdns-whitelist-file=/var/qmail/spamdyke/whitelist_rdns
ip-whitelist-file=/var/qmail/spamdyke/whitelist_ip
sender-whitelist-file=/var/qmail/spamdyke/whitelist_senders
%lx_greet_delay%
%lx_maximum_recipients%
header-blacklist-file=/var/qmail/spamdyke/blacklist_headers
#RBL BLOCKLISTS
%lx_dns_blacklist_entries%
%lx_reject_missing_sender_mx%
%lx_reject_empty_rdns%
%lx_reject_ip_in_cc_rdns%
%lx_reject_unresolvable_rdns%
#MySQL-Logging:
#config-mysql-database=spamdyke
#config-mysql-username=spamdyke
#config-mysql-password=spamdyke
-
Update with 'yum clean all; yum update -y' and then go to 'admin > mail server setting > spamdyke > click update'
-
After the complete update getting error as below
sh /etc/cron.daily/spamdyke
/usr/bin/find: missing argument to `-exec'
/usr/bin/find: missing argument to `-exec'
-
Inform 'yum list installed kloxomr7'.
-
Loaded plugins: fastestmirror, presto, priorities, protectbase, replace
Loading mirror speeds from cached hostfile
* base: repos.dfw.quadranet.com
* extras: repo1.ash.innoscale.net
* mratwork-epel: fedora-epel.mirror.lstn.net
* mratwork-ius-archive: mirror.team-cymru.org
* mratwork-ius-stable: mirror.team-cymru.org
* mratwork-release-neutral-noarch: rpms.mratwork.com
* mratwork-release-version-arch: rpms.mratwork.com
* mratwork-webtatic: repo.webtatic.com
* updates: mirror.raystedman.net
0 packages excluded due to repository protections
Installed Packages
kloxomr7.noarch 7.0.0.c-2017082002.mr @mratwork-release-neutral-noarch
-
Try 'rm -f /etc/spamdyke.conf' and then go to 'admin > mail server setting > spamdyke > click update'.
And then inform 'cat /etc/spamdyke.conf'.
-
#Plesk-Addon
log-level=info
idle-timeout-secs=180
qmail-rcpthosts-file=/var/qmail/control/rcpthosts
qmail-morercpthosts-cdb=/var/qmail/control/morercpthosts.cdb
tls-certificate-file=/var/qmail/control/servercert.pem
#AUTH FROM xinetd-conf
smtp-auth-command=/var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /bin/true
smtp-auth-level=ondemand-encrypted
graylist-level=none
graylist-dir=/var/qmail/spamdyke/greylist
#GREYLIST MINIMUM=5 Min
graylist-min-secs=300
#GREYLIST MAX=3 Months
graylist-max-secs=1814400
sender-blacklist-file=/var/qmail/spamdyke/blacklist_senders
recipient-blacklist-file=/var/qmail/spamdyke/blacklist_recipients
ip-in-rdns-keyword-blacklist-file=/var/qmail/spamdyke/blacklist_keywords
ip-blacklist-file=/var/qmail/spamdyke/blacklist_ip
rdns-whitelist-file=/var/qmail/spamdyke/whitelist_rdns
ip-whitelist-file=/var/qmail/spamdyke/whitelist_ip
sender-whitelist-file=/var/qmail/spamdyke/whitelist_senders
greeting-delay-secs=1
max-recipients=30
header-blacklist-file=/var/qmail/spamdyke/blacklist_headers
#RBL BLOCKLISTS
dns-blacklist-entry=zen.spamhaus.org
dns-blacklist-entry=bl.spamcop.net
dns-blacklist-entry=bogons.cymru.com
dns-blacklist-entry=dnsbl-0.uceprotect.net
dns-blacklist-entry=dnsbl-1.uceprotect.net
dns-blacklist-entry=dnsbl-2.uceprotect.net
dns-blacklist-entry=dnsbl-3.uceprotect.net
dns-blacklist-entry=list.dsbl.org
reject-sender=no-mx
reject-empty-rdns
#reject-ip-in-cc-rdns
reject-unresolvable-rdns
#MySQL-Logging:
#config-mysql-database=spamdyke
#config-mysql-username=spamdyke
#config-mysql-password=spamdyke
Still getting the same error
sh /etc/cron.daily/spamdyke
/usr/bin/find: missing argument to `-exec'
/usr/bin/find: missing argument to `-exec'
-
Inform here 'sh -x /etc/cron.daily/spamdyke'
-
+ /usr/bin/find /var/qmail/spamdyke/greylist/ -type f -mmin +10080 -size 0 -exec rm -f '{}'
/usr/bin/find: missing argument to `-exec'
+ '[' -f /usr/bin/bc ']'
++ cut -d = -f 2
++ grep graylist-max-secs /etc/spamdyke.conf
+ GRAYLIST_MAX_SECS=1814400
++ bc -l
++ echo 'scale=0 ; 1814400 / 60'
+ GRAYLIST_MAX_SECS=30240
+ /usr/bin/find /var/qmail/spamdyke/greylist/ -type f -mmin +30240 -exec rm -f '{}'
/usr/bin/find: missing argument to `-exec'
-
It's weird. Because then same command in my servers appear:
> sh -x /etc/cron.daily/spamdyke
+ /usr/bin/find /var/qmail/spamdyke/greylist/ -type f -mmin +10080 -size 0 -exec rm -f '{}' ';'
+ '[' -f /usr/bin/bc ']'
++ grep graylist-max-secs /etc/spamdyke.conf
++ cut -d = -f 2
+ GRAYLIST_MAX_SECS=1814400
++ echo 'scale=0 ; 1814400 / 60'
++ bc -l
+ GRAYLIST_MAX_SECS=30240
+ /usr/bin/find /var/qmail/spamdyke/greylist/ -type f -mmin +30240 -exec rm -f '{}' ';'
Inform here 'uname -r'.
-
uname -r
2.6.32-642.15.1.el6.x86_64
-
Edit /etc/spamdyke.conf via 'file manager' in panel with add '# only add comment'.
-
After adding the above comment line, error still exists
/usr/bin/find: invalid argument `-exec' to `-mmin'
-
Ok, give me your ssh access.
-
Will share you over PM
-
Something wrong with /etc/cron.daily/spamdyke.
In your server:
#!/bin/sh
# Delete empty files (older than one week)
/usr/bin/find /var/qmail/spamdyke/greylist/ -type f -mmin +10080 -size 0 -exec rm -f {} ;
if [ -f /usr/bin/bc ] ; then
# If installed, it can automatically be determined
#GRAYLIST_MAX_SECS=$(grep 'graylist-max-secs' /etc/spamdyke.conf)
GRAYLIST_MAX_SECS=$(grep 'graylist-max-secs' /etc/spamdyke.conf | cut -d = -f 2)
GRAYLIST_MAX_SECS=$(echo "scale=0 ; $GRAYLIST_MAX_SECS / 60" | bc -l)
else
# Note: should work with graylist-max-secs / 60 / etc / spamdyke.conf identical
# older than 30240 minutes (= 3 weeks)
GRAYLIST_MAX_SECS=30240
fi
# Delete outdated posts
/usr/bin/find /var/qmail/spamdyke/greylist/ -type f -mmin +$GRAYLIST_MAX_SECS -exec rm -f {} ;
In my server:
#!/bin/sh
# Delete empty files (older than one week)
/usr/bin/find /var/qmail/spamdyke/greylist/ -type f -mmin +10080 -size 0 -exec rm -f {} \;
if [ -f /usr/bin/bc ] ; then
# If installed, it can automatically be determined
GRAYLIST_MAX_SECS=$(grep 'graylist-max-secs' /etc/spamdyke.conf | cut -d = -f 2)
GRAYLIST_MAX_SECS=$(echo "scale=0 ; $GRAYLIST_MAX_SECS / 60" | bc -l)
else
# Note: should work with graylist-max-secs / 60 / etc / spamdyke.conf identical
# older than 30240 minutes (= 3 weeks)
GRAYLIST_MAX_SECS=30240
fi
# Delete outdated posts
/usr/bin/find /var/qmail/spamdyke/greylist/ -type f -mmin +$GRAYLIST_MAX_SECS -exec rm -f {} \;
So, different is ';' versus '\;'