Cronjob is running every minute but not at a specific time












1















The job works if set like this:



*/1 * * * * /usr/bin/php /home/test/cron/test.php


And if set to something like:



15 20 * * * /usr/bin/php /home/test/cron/test.php


it's not working.



[root@localhost mail]# uname -or
2.6.18-308.el5 GNU/Linux
[root@localhost mail]# cat /etc/*elease
#CentOS release 5.8 (Final)
redhat-4


I don't know if this going to help but when I do this:



[root@localhost mail]# date
Wed Aug 5 20:54:02 KST 2015


and when an email comes the date is displayed like so:



Wed Aug  5 06:51:01 2015


which is actually one hour behind the time.
The date was showing up EDT instead of KST, so I changed etc/profile but the cron job still wouldn't work.
I'm new to linux and don't really know what info would be useful, so I can provide more on your request.
Hope you can help me.










share|improve this question




















  • 1





    first read the man page for cron. Because the second option means: at 20.15 of everyday run the job.

    – BitsOfNix
    Aug 5 '15 at 12:37






  • 1





    When/how often do you want the cronjob to take place? The cron syntax is Min Hour Day Month 'Day of Week' see en.wikipedia.org/wiki/Cron#Examples

    – Centimane
    Aug 5 '15 at 12:44













  • I want to run at noon, but since I can't wait one day to test I set to something like 5 minutes in the future. it's correct in this example i was trying to run it at 20:15 KST everyday. Do you have any ideas what maybe the problem ?

    – Cԃաԃ
    Aug 5 '15 at 12:55
















1















The job works if set like this:



*/1 * * * * /usr/bin/php /home/test/cron/test.php


And if set to something like:



15 20 * * * /usr/bin/php /home/test/cron/test.php


it's not working.



[root@localhost mail]# uname -or
2.6.18-308.el5 GNU/Linux
[root@localhost mail]# cat /etc/*elease
#CentOS release 5.8 (Final)
redhat-4


I don't know if this going to help but when I do this:



[root@localhost mail]# date
Wed Aug 5 20:54:02 KST 2015


and when an email comes the date is displayed like so:



Wed Aug  5 06:51:01 2015


which is actually one hour behind the time.
The date was showing up EDT instead of KST, so I changed etc/profile but the cron job still wouldn't work.
I'm new to linux and don't really know what info would be useful, so I can provide more on your request.
Hope you can help me.










share|improve this question




















  • 1





    first read the man page for cron. Because the second option means: at 20.15 of everyday run the job.

    – BitsOfNix
    Aug 5 '15 at 12:37






  • 1





    When/how often do you want the cronjob to take place? The cron syntax is Min Hour Day Month 'Day of Week' see en.wikipedia.org/wiki/Cron#Examples

    – Centimane
    Aug 5 '15 at 12:44













  • I want to run at noon, but since I can't wait one day to test I set to something like 5 minutes in the future. it's correct in this example i was trying to run it at 20:15 KST everyday. Do you have any ideas what maybe the problem ?

    – Cԃաԃ
    Aug 5 '15 at 12:55














1












1








1








The job works if set like this:



*/1 * * * * /usr/bin/php /home/test/cron/test.php


And if set to something like:



15 20 * * * /usr/bin/php /home/test/cron/test.php


it's not working.



[root@localhost mail]# uname -or
2.6.18-308.el5 GNU/Linux
[root@localhost mail]# cat /etc/*elease
#CentOS release 5.8 (Final)
redhat-4


I don't know if this going to help but when I do this:



[root@localhost mail]# date
Wed Aug 5 20:54:02 KST 2015


and when an email comes the date is displayed like so:



Wed Aug  5 06:51:01 2015


which is actually one hour behind the time.
The date was showing up EDT instead of KST, so I changed etc/profile but the cron job still wouldn't work.
I'm new to linux and don't really know what info would be useful, so I can provide more on your request.
Hope you can help me.










share|improve this question
















The job works if set like this:



*/1 * * * * /usr/bin/php /home/test/cron/test.php


And if set to something like:



15 20 * * * /usr/bin/php /home/test/cron/test.php


it's not working.



[root@localhost mail]# uname -or
2.6.18-308.el5 GNU/Linux
[root@localhost mail]# cat /etc/*elease
#CentOS release 5.8 (Final)
redhat-4


I don't know if this going to help but when I do this:



[root@localhost mail]# date
Wed Aug 5 20:54:02 KST 2015


and when an email comes the date is displayed like so:



Wed Aug  5 06:51:01 2015


which is actually one hour behind the time.
The date was showing up EDT instead of KST, so I changed etc/profile but the cron job still wouldn't work.
I'm new to linux and don't really know what info would be useful, so I can provide more on your request.
Hope you can help me.







cron timezone






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago









Rui F Ribeiro

40.5k1479137




40.5k1479137










asked Aug 5 '15 at 12:02









CԃաԃCԃաԃ

1085




1085








  • 1





    first read the man page for cron. Because the second option means: at 20.15 of everyday run the job.

    – BitsOfNix
    Aug 5 '15 at 12:37






  • 1





    When/how often do you want the cronjob to take place? The cron syntax is Min Hour Day Month 'Day of Week' see en.wikipedia.org/wiki/Cron#Examples

    – Centimane
    Aug 5 '15 at 12:44













  • I want to run at noon, but since I can't wait one day to test I set to something like 5 minutes in the future. it's correct in this example i was trying to run it at 20:15 KST everyday. Do you have any ideas what maybe the problem ?

    – Cԃաԃ
    Aug 5 '15 at 12:55














  • 1





    first read the man page for cron. Because the second option means: at 20.15 of everyday run the job.

    – BitsOfNix
    Aug 5 '15 at 12:37






  • 1





    When/how often do you want the cronjob to take place? The cron syntax is Min Hour Day Month 'Day of Week' see en.wikipedia.org/wiki/Cron#Examples

    – Centimane
    Aug 5 '15 at 12:44













  • I want to run at noon, but since I can't wait one day to test I set to something like 5 minutes in the future. it's correct in this example i was trying to run it at 20:15 KST everyday. Do you have any ideas what maybe the problem ?

    – Cԃաԃ
    Aug 5 '15 at 12:55








1




1





first read the man page for cron. Because the second option means: at 20.15 of everyday run the job.

– BitsOfNix
Aug 5 '15 at 12:37





first read the man page for cron. Because the second option means: at 20.15 of everyday run the job.

– BitsOfNix
Aug 5 '15 at 12:37




1




1





When/how often do you want the cronjob to take place? The cron syntax is Min Hour Day Month 'Day of Week' see en.wikipedia.org/wiki/Cron#Examples

– Centimane
Aug 5 '15 at 12:44







When/how often do you want the cronjob to take place? The cron syntax is Min Hour Day Month 'Day of Week' see en.wikipedia.org/wiki/Cron#Examples

– Centimane
Aug 5 '15 at 12:44















I want to run at noon, but since I can't wait one day to test I set to something like 5 minutes in the future. it's correct in this example i was trying to run it at 20:15 KST everyday. Do you have any ideas what maybe the problem ?

– Cԃաԃ
Aug 5 '15 at 12:55





I want to run at noon, but since I can't wait one day to test I set to something like 5 minutes in the future. it's correct in this example i was trying to run it at 20:15 KST everyday. Do you have any ideas what maybe the problem ?

– Cԃաԃ
Aug 5 '15 at 12:55










1 Answer
1






active

oldest

votes


















3














Updating /etc/localtime for the system wide time zone setting might fix your problem. I guess KST stands for Korea Standard Time, so you might want to choose /usr/share/zoneinfo/Asia/Seoul for it. You can also run tzselect to know which file in /usr/share/zoneinfo to choose.



$ sudo cp /etc/localtime /etc/localtime.orig # for backup
$ sudo cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
$ date
Wed Aug 5 21:50:23 KST 2015


Then restart cron, or reboot your server.






share|improve this answer
























  • Thank you very much Yaegashi ^_^. It was exactly the problem. You should go and answer dozens of other similar questions and collect the loot :).

    – Cԃաԃ
    Aug 5 '15 at 13:17











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f220319%2fcronjob-is-running-every-minute-but-not-at-a-specific-time%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














Updating /etc/localtime for the system wide time zone setting might fix your problem. I guess KST stands for Korea Standard Time, so you might want to choose /usr/share/zoneinfo/Asia/Seoul for it. You can also run tzselect to know which file in /usr/share/zoneinfo to choose.



$ sudo cp /etc/localtime /etc/localtime.orig # for backup
$ sudo cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
$ date
Wed Aug 5 21:50:23 KST 2015


Then restart cron, or reboot your server.






share|improve this answer
























  • Thank you very much Yaegashi ^_^. It was exactly the problem. You should go and answer dozens of other similar questions and collect the loot :).

    – Cԃաԃ
    Aug 5 '15 at 13:17
















3














Updating /etc/localtime for the system wide time zone setting might fix your problem. I guess KST stands for Korea Standard Time, so you might want to choose /usr/share/zoneinfo/Asia/Seoul for it. You can also run tzselect to know which file in /usr/share/zoneinfo to choose.



$ sudo cp /etc/localtime /etc/localtime.orig # for backup
$ sudo cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
$ date
Wed Aug 5 21:50:23 KST 2015


Then restart cron, or reboot your server.






share|improve this answer
























  • Thank you very much Yaegashi ^_^. It was exactly the problem. You should go and answer dozens of other similar questions and collect the loot :).

    – Cԃաԃ
    Aug 5 '15 at 13:17














3












3








3







Updating /etc/localtime for the system wide time zone setting might fix your problem. I guess KST stands for Korea Standard Time, so you might want to choose /usr/share/zoneinfo/Asia/Seoul for it. You can also run tzselect to know which file in /usr/share/zoneinfo to choose.



$ sudo cp /etc/localtime /etc/localtime.orig # for backup
$ sudo cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
$ date
Wed Aug 5 21:50:23 KST 2015


Then restart cron, or reboot your server.






share|improve this answer













Updating /etc/localtime for the system wide time zone setting might fix your problem. I guess KST stands for Korea Standard Time, so you might want to choose /usr/share/zoneinfo/Asia/Seoul for it. You can also run tzselect to know which file in /usr/share/zoneinfo to choose.



$ sudo cp /etc/localtime /etc/localtime.orig # for backup
$ sudo cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
$ date
Wed Aug 5 21:50:23 KST 2015


Then restart cron, or reboot your server.







share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 5 '15 at 12:54









yaegashiyaegashi

8,38611734




8,38611734













  • Thank you very much Yaegashi ^_^. It was exactly the problem. You should go and answer dozens of other similar questions and collect the loot :).

    – Cԃաԃ
    Aug 5 '15 at 13:17



















  • Thank you very much Yaegashi ^_^. It was exactly the problem. You should go and answer dozens of other similar questions and collect the loot :).

    – Cԃաԃ
    Aug 5 '15 at 13:17

















Thank you very much Yaegashi ^_^. It was exactly the problem. You should go and answer dozens of other similar questions and collect the loot :).

– Cԃաԃ
Aug 5 '15 at 13:17





Thank you very much Yaegashi ^_^. It was exactly the problem. You should go and answer dozens of other similar questions and collect the loot :).

– Cԃաԃ
Aug 5 '15 at 13:17


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f220319%2fcronjob-is-running-every-minute-but-not-at-a-specific-time%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Loup dans la culture

How to solve the problem of ntp “Unable to contact time server” from KDE?

ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux