Solved

Adjusting Cron Jobs ?

Posted on 2011-02-21
9
1,393 Views
Last Modified: 2012-05-11
I am trying to edit this cron job to execuit every 30 days because I am getting to many alurts evey 8 hrs from what it is showing me

0 8,20 * * * /root/rkhunter.sh

now I tried
crontab -e

Then I went to that line and put
0 0,30 * * * /root/rkhunter.sh

When I went to save it gave me the below error

"/tmp/crontab.XXXXdksuZh":3: bad hour
errors in crontab file, can't install.
Do you want to retry the same edit?
Enter Y or N

clear                                                          root@server [~]# crontab -l
0 4 * * * /usr/sbin/cxs --upgrade --quiet
0 8,20 * * * /root/chkrootkit.sh | grep -v .packlist
0 8,20 * * * /root/rkhunter.sh

0 1 * * * /root/mysql.sh > /dev/null 2>&1
8,23,38,53 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
*/5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
2,58 * * * * /usr/local/bandmin/bandmin
0 0 * * * /usr/local/bandmin/ipaddrmap
26 3 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
36 6 * * * cd /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/scripts/ ; /usr/local/cpanel/3rdparty/bin/php-cgi cron.php > /dev/null 2>&1


10 7 * * * cd /usr/local/assp;perl /usr/local/assp/rebuildspamdb.pl
MAILTO=""
*/59 * * * * /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/ex_localdomains.php clean_logs=yes daniolo=yes
*/3 * * * * /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/update_email.php
*/3 * * * * /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/status.php long=1 daniolo=yes
*/4 * * * * /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/spam_cronjob.php high=7
10 8 * * * /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/clear_spambox.php sday=3 sp=yes limitspace=10000 remdays=1
*/20 * * * * /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/find_abusers.php sw=7 sc=8 er=13 lm=13 dc=8 rl=20 dn=1 on=1
*/27 * * * * /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/find_abusers.php show=2 sc=2 dm=file er=6 lm=4 dc=2 on=1
0 9 * * * /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/signatures.php
2 */6 * * * /usr/sbin/exiqgrep -o 16800 -i | /usr/bin/xargs /usr/sbin/exim -Mrm
MAILTO=""
30 */4 * * * /usr/bin/test -x /scripts/update_db_cache && /scripts/update_db_cache
45 */8 * * * /usr/bin/test -x /usr/local/cpanel/bin/optimizefs && /usr/local/cpanel/bin/optimizefs
0 1 * * * /scripts/cpbackup
35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpanel/bin/tail-check
30 */2 * * * /usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1
15 */2 * * * /usr/local/cpanel/bin/dbindex >/dev/null 2>&1
11 4 * * * /usr/bin/freshclam --quiet --no-warnings
0 5 * * * /scripts/upcp
0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1
root@server [~]#

Open in new window

0
Comment
Question by:sobeservices2
  • 4
  • 4
9 Comments
 
LVL 19

Accepted Solution

by:
simon3270 earned 500 total points
ID: 34946940
crontab lines are
minutes hour day month weekday command

so for once a month, you could have

0 20 2 * * /root/rkhunter.sh

which would run the command at 8pm on the second of every month.

If you wanted it weekly, you could run it every Sunday (day zero)

0 20 * * 0 /root/rkhunter.sh

or every Monday

0 20 * * 1 /root/rkhunter.sh

For each of the above, you can set the time to whatever suits you best (I just picked 8pm because it was one of the times in your original line).
0
 

Author Comment

by:sobeservices2
ID: 34946977
Thanks .. I will give it a try in a few something just came up.
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 34948465
30 is an invalid hour. you need to play with the next filed which is for days of the month
0
 

Author Comment

by:sobeservices2
ID: 34951738
I put everything to just * for this line below and I am still getting cron reports

as follows how can I disable these too many

[ Rootkit Hunter version 1.3.8 ]

Checking rkhunter data files...
  Checking file mirrors.dat                                  [ No update ]
  Checking file programs_bad.dat                             [ No update ]
  Checking file backdoorports.dat                            [ No update ]
  Checking file suspscan.dat                                 [ No update ]
  Checking file i18n/cn                                      [ No update ]
  Checking file i18n/de                                      [ No update ]
  Checking file i18n/en                                      [ No update ]
  Checking file i18n/zh                                      [ No update ]
  Checking file i18n/zh.utf8                                 [ No update ]
[ Rootkit Hunter version 1.3.8 ]
File updated: searched for 164 files, found 141
Warning: The SSH configuration option 'PermitRootLogin' has not been set.
         The default value may be 'yes', to allow root access.
Warning: Hidden directory found: /dev/.udev
Warning: Hidden file found: /etc/.logrotate.conf.swp: data
Warning: Hidden file found: /usr/bin/.ssh.hmac: ASCII text
Warning: Hidden file found: /usr/bin/.fipscheck.hmac: ASCII text
Warning: Hidden file found: /usr/sbin/.sshd.hmac: ASCII text

0 8,20 * * * /root/rkhunter.sh

Open in new window

0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:sobeservices2
ID: 34951846
0 20 2 * *  /root/chkrootkit.sh | grep -v .packlist
0 20 2 * * /root/rkhunter.sh

Now I have this and its running over and over and over doesn't seem to stop
0
 
LVL 19

Expert Comment

by:simon3270
ID: 34952465
The ones above (in ID:34951846) should be fine - both will run the script at 8pm on the second of the month.

If you have
    * * * * * /root/rkhunter.sh
it will run every minute.
0
 
LVL 19

Expert Comment

by:simon3270
ID: 34952476
Have you left old rkhunter lines in your crontab?
0
 

Author Comment

by:sobeservices2
ID: 34952709
No left over lines in my crontab.

***** that explains it
Didn't know * meant every min

So you would say the best way would be commit it out if I don't want to use it right?

Thanks
0
 
LVL 19

Expert Comment

by:simon3270
ID: 34952858
Commenting out with # would be fine - I do that if I have an entry I don't want now, but may want again later.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to clone solaris 10 machine 33 114
How to mount an LVM partition that is part of a disk image. 3 50
nagios 4 php error after installation 6 78
How to learn Linux? 10 43
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now