Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1449
  • Last Modified:

Adjusting Cron Jobs ?

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
sobeservices2
Asked:
sobeservices2
  • 4
  • 4
1 Solution
 
simon3270Commented:
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
 
sobeservices2Author Commented:
Thanks .. I will give it a try in a few something just came up.
0
 
omarfaridCommented:
30 is an invalid hour. you need to play with the next filed which is for days of the month
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
sobeservices2Author Commented:
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
 
sobeservices2Author Commented:
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
 
simon3270Commented:
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
 
simon3270Commented:
Have you left old rkhunter lines in your crontab?
0
 
sobeservices2Author Commented:
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
 
simon3270Commented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now