Jump to content

Sql Query From Cronjob


atn2017

Recommended Posts

Hi there. I tried to add a cronjob on Tommy Server for a simple SQL update query on my DB using the command below, but it didn't work:

 

mysql --user=DBUSER --password=PASS --database=DBNAME --execute="UPDATE table SET colunm=value;"

 

 

I've set this cronjob to 13:30 20th MAR but nothing happened. Do you guys have any tip on the syntax I used or where can I see the log for this query ?

 

Thanks!

Paulo.

 

 

 

Link to comment
Share on other sites

 

I've set this cronjob to 13:30 20th MAR but nothing happened. Do you guys have any tip on the syntax I used or where can I see the log for this query ?

 

Thanks!

Paulo.

 

Your cron hasn't run yet. The server time is PST. As of the time of this post, it was 8:36 am.

  • Like 1
Link to comment
Share on other sites

 

 

I've set this cronjob to 13:30 20th MAR but nothing happened. Do you guys have any tip on the syntax I used or where can I see the log for this query ?

 

Thanks!

Paulo.

 

Your cron hasn't run yet. The server time is PST. As of the time of this post, it was 8:36 am.

 

Thanks ! I was wondering about it... Because I checked tommy time zone at http://heliohost.grd.net.pl/server-time/, but I think it's wrong....

Link to comment
Share on other sites

@Krydos & wolstech, I set up a cron to test with this syntax:

35 8 * * * php -q /home/byron/public_html/php/mail.php

And it ran at 8:35 am PST.

 

:D

 

@Krydos & wolstech, I set up a cron to test with this syntax:

35 8 * * * php -q /home/byron/public_html/php/mail.php

And it ran at 8:35 am PST.

 

By the way, are you on Tommy ? PST right now is 8:07 AM......

Link to comment
Share on other sites

...I hate timezones.

 

I'm guessing cron honors the local timezone settings since the server clock is UTC...

 

My 1st attempt was using UTC, but didn't work. I'm now trying Pacific Time..... Let's see....

 

 

 

well... I check up on https://time.is/PST ... it says 1h earlier..... I'll do again with 1h later....

 

Worked, @Byron ! Thanks, pal....

 

Sorry about that. We're actually on PDT (Pacific Daylight Time). https://www.google.com/search?q=Pacific+Daylight+Time

 

Perfect... Is there a way to confirm it in the future ?

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...