We help IT Professionals succeed at work.

Cron job not running

Andrew Cioppa
on
540 Views
Last Modified: 2012-05-08
I have a cron job set, if i manually do "run-parts" /etc/cron.hourly" it works and creates the mysql backups i want. if i wait for it to happen on its own it never actually runs.

There is nothing in the log stating an error, the cron job is:
0,15,30,45 * * * * /usr/bin/mysqldump -u root -ppassword databse > dbname.`/bin/date +\%Y\%m\%d`

i have it set every 15 just for testing, once working its a daily job. I installed it by running crontab -e and entering it.

Im on the latest redhat

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2007

Commented:
How have you defined the cronjob?  Have you please a script in /etc/cron.hourly directory?

Author

Commented:
i tried 2 ways, i just added the entry to the file opened by running crontab -e, and i made a file in crontab.hourly and put the info there as well.
CERTIFIED EXPERT
Top Expert 2007
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Hi

edit file

/etc/crontab

add line
0,15,30,45 * * * *  root /usr/bin/mysqldump -u root -ppassword databse > dbname.`/bin/date +\%Y\%m\%d`

RESTART cron service

/etc/init.d/cron restart

Please check if that works.

D
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.