Solved

Adjusting Cron Jobs ?

Posted on 2011-02-21
9
1,380 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
Comment Utility
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
Comment Utility
Thanks .. I will give it a try in a few something just came up.
0
 
LVL 40

Expert Comment

by:omarfarid
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:sobeservices2
Comment Utility
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
Comment Utility
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
Comment Utility
Have you left old rkhunter lines in your crontab?
0
 

Author Comment

by:sobeservices2
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

771 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

10 Experts available now in Live!

Get 1:1 Help Now