[SOLVED] crontab doesn't execute the jobs at the right time
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
crontab doesn't execute the jobs at the right time
Hello,
I'm battling with this strange problem for a while now:
i run a local server under ubuntu 11.04, it's used as a web server for various items registered in a database. And i want to save this database each hour of the working day.
So i made a script containing a mysqldump, and i use cron to run this script with the following line:
now the weird thing: the server starts the script at 10 instead of 8 (and after 10 it works perfectly)
I've tried numerous ways to do the job: the original one was in crontab -e using VI, then using gedit to edit the/etc/crontab file. Both did the same thing.
I tried a different way to specify the minutes:
01 8-18 * * * or 0 8-18 * * *
none of them worked.
the server is at the right time and date and timezone, so are the only 2 users created on it (root and user).
I've tried this on another ubuntu 11.04 and the same problem arose.
the hwclock runs on CET time (i'm on gmt+1) it's exactly one hour earlier than system time. but if it was related to that, all the backups would have a one hour delay, it's not the case here, it's starts running at 10 instead of 8, but stops at the right time (18).
trying the run-parts now, with the script put into /etc/cron.hourly.
the script is launched nicelly at whatever hour i want, but for whatever reason i don't get, it's the mysqldump line in the script that can only be run starting at 10.
here the msqldump line:
mysqldump -uroot -ppassword --opt --all-databases > alldatadases_`date +"%k%M"`.sql
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.