We help IT Professionals succeed at work.

Crontab Problem

tripat
tripat asked
on
Comment
Watch Question

Commented:
create a directory for the new   cron.minutes and put you command in a file. make sure you copy the file 0anacron to that directory and modifty it to cron.minutes.  make sure permissions are correct on script file.

modify main scripts for run-parts to look so
# run-parts
* * * * * root run-parts /etc/cron.minutes
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

I'm sure your are already running mainite on your pc, type "setup" from console and go to startup services, make sure cron is checked to start automatically upon startup.

Author

Commented:
Hi I have done the modifications after which the main file "crontab" have following contents:

-------------------
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
* * * * * root run-parts /etc/cron.minutes
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

# Monitor services to make sure everything is still okay.
0,15,30,45 * * * * root /usr/local/sbin/swatch >>/var/coballt/adm.log 2>&1

-------------------

Also I have created the directory "cron.minutes" and created a file "massemail" in which I added my command so the contents of "massemail" is:

---------------
* * * * * lynx -dump http://greatpresence.com/~massemail/1.php
 
----------------

I have checked permissions on 1.php file and is set to CHMOD 777.

But I did not understood what do u mean by copy file 0anacron and rename it to cron.minutes

Do I have to run command crontab to start/install the script, pls tell me further steps to take.

Regards,
Tripat





Commented:
look under /etc/cron.daily and you will see a file called "0anacron" copy that file, or just view it to understand why it should be there.  copy this file to /etc/cron.minutes and see it run.
Commented:
please accept answer so we can delete question. :-) OR reject answer and delete, either way.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.