i did this from the console crontab -e
then i inserted this in my vi editor 10 * * * * curl http://mysite.com/test.php
then i exited vi
then i did crontab -l and the cron job was listed
then i did
/sbin/service crond start
and i waited for 10 mins to get a message echo to my console. the message is displayed in my browser when the php script(http://mysite.com/test.php) is loaded via my browser. The message is also shown on my console when d curl command is run direct from the console.
the problem is getting the message from the cronjob.
what could be wrong ? could it be that the job is not well setup ?
note , i logged in as root user.
please help
regards
kunle
On Tue, Jan 22, 2013 at 1:23 PM, Adekoya Adekunle <adekunleadekoya@gmail.com
wrote:
i did this from the console crontab -e
then i inserted this in my vi editor 10 * * * * curl http://mysite.com/test.php
That will run 10 minutes after each hour.
If you want it to run every ten minutes use: **/10* * * * * curl http://mysite.com/test.php for ten minute intervals.
Check /var/log/cron to see if it gives you any hints.
then i exited vi
then i did crontab -l and the cron job was listed
then i did
/sbin/service crond start
and i waited for 10 mins to get a message echo to my console. the message is displayed in my browser when the php script(http://mysite.com/test.php) is loaded via my browser. The message is also shown on my console when d curl command is run direct from the console.
the problem is getting the message from the cronjob.
what could be wrong ? could it be that the job is not well setup ?
note , i logged in as root user.
please help
regards
kunle _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On 2013-01-22, SilverTip257 silvertip257@gmail.com wrote:
If you want it to run every ten minutes use: **/10* * * * * curl http://mysite.com/test.php for ten minute intervals.
It is not clear where the extra asterisks came from, but the syntax should be
*/10 * * * * curl ....
Strictly speaking, it is not 10 minute intervals; it is every multiple of 10. So if you save your crontab at 7:09, the job will still run at 7:10, not 7:19--it won't figure out the current time and run every ten minutes from then. (Nobody here mentioned it, but I've seen it come up in other contexts.)
and i waited for 10 mins to get a message echo to my console. the message is displayed in my browser when the php script(http://mysite.com/test.php) is loaded via my browser. The message is also shown on my console when d curl command is run direct from the console.
the problem is getting the message from the cronjob.
What message? If you are hoping to see the curl output, then ...
note , i logged in as root user.
...you need to check root's mailbox. If you haven't checked there yet you should do so. If you want to do something else with the output, you need to specify what that is.
If it's not there, then as the previous poster mentioned check /var/log/cron.
--keith
On Tue, Jan 22, 2013 at 1:46 PM, Keith Keller < kkeller@wombat.san-francisco.ca.us> wrote:
On 2013-01-22, SilverTip257 silvertip257@gmail.com wrote:
If you want it to run every ten minutes use: **/10* * * * * curl http://mysite.com/test.php for ten minute intervals.
It is not clear where the extra asterisks came from, but the syntax should be
I composed with HTML and bolded */10 Bold translates to putting an asterisk around the text ... resulting in **/10* instead of the intended */10
*/10 * * * * curl ....
Strictly speaking, it is not 10 minute intervals; it is every multiple of 10. So if you save your crontab at 7:09, the job will still run at 7:10, not 7:19--it won't figure out the current time and run every ten minutes from then. (Nobody here mentioned it, but I've seen it come up in other contexts.)
Good point ^^
and i waited for 10 mins to get a message echo to my console. the
message
is displayed in my browser when the php script(
is loaded via my browser. The message is also shown on my console when
d
curl command is run direct from the console.
the problem is getting the message from the cronjob.
What message? If you are hoping to see the curl output, then ...
note , i logged in as root user.
...you need to check root's mailbox. If you haven't checked there yet you should do so. If you want to do something else with the output, you need to specify what that is.
If it's not there, then as the previous poster mentioned check /var/log/cron.
--keith
-- kkeller@wombat.san-francisco.ca.us
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On 2013-01-22, SilverTip257 silvertip257@gmail.com wrote:
I composed with HTML and bolded */10
Some people consider it rude to use HTML on a mailing list. And, as we've just seen, it can actually be converted to something incorrect.
--keith
On Tue, Jan 22, 2013 at 10:24 PM, Keith Keller < kkeller@wombat.san-francisco.ca.us> wrote:
On 2013-01-22, SilverTip257 silvertip257@gmail.com wrote:
I composed with HTML and bolded */10
Some people consider it rude to use HTML on a mailing list. And, as we've just seen, it can actually be converted to something incorrect.
I realize you are likely in no way being confrontational here.
No surprise, another item for sticklers to complain about. Kind of like top-posting ... complain all we want, somebody will do it, and unless we break their fingers or do it for them they will unintentionally do it. :-/
I'll be most certain to make every attempt not to make use of HTML features in the future. I figured I should explain why my message unintentionally showed up with asterisks earlier, but that was a can-o-worms. :(
Now if Google/Gmail could let things be -- and not change my settings back to HTML from the last time I set it to plain text ... plain text is no longer an option via the webui, swell.
SilverTip257 wrote:
On Tue, Jan 22, 2013 at 10:24 PM, Keith Keller < kkeller@wombat.san-francisco.ca.us> wrote:
On 2013-01-22, SilverTip257 silvertip257@gmail.com wrote:
I composed with HTML and bolded */10
Some people consider it rude to use HTML on a mailing list. And, as we've just seen, it can actually be converted to something incorrect.
<snip>
Now if Google/Gmail could let things be -- and not change my settings back to HTML from the last time I set it to plain text ... plain text is no longer an option via the webui, swell.
But, I mean, html email makes it *so* much easier to send spam and malware, why would you not want to use it...?
mark, annoyed that t-bird thinks "plain text" doesn't *really* mean ASCII or equivalent
On Wed, Jan 23, 2013 at 10:59 AM, m.roth@5-cent.us wrote:
SilverTip257 wrote:
On Tue, Jan 22, 2013 at 10:24 PM, Keith Keller < kkeller@wombat.san-francisco.ca.us> wrote:
On 2013-01-22, SilverTip257 silvertip257@gmail.com wrote:
I composed with HTML and bolded */10
Some people consider it rude to use HTML on a mailing list. And, as we've just seen, it can actually be converted to something incorrect.
<snip> > Now if Google/Gmail could let things be -- and not change my settings back > to HTML from the last time I set it to plain text ... plain text is no > longer an option via the webui, swell.
But, I mean, html email makes it *so* much easier to send spam and malware, why would you not want to use it...?
I'd prefer the choice (so I can opt not to use it). Thanks for the chuckle Mark.
mark, annoyed that t-bird thinks "plain text" doesn't *really* mean ASCII or equivalent
:)
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On 2013-01-23, SilverTip257 silvertip257@gmail.com wrote:
On Tue, Jan 22, 2013 at 10:24 PM, Keith Keller < kkeller@wombat.san-francisco.ca.us> wrote:
On 2013-01-22, SilverTip257 silvertip257@gmail.com wrote:
I composed with HTML and bolded */10
Some people consider it rude to use HTML on a mailing list. And, as we've just seen, it can actually be converted to something incorrect.
I realize you are likely in no way being confrontational here.
No surprise, another item for sticklers to complain about.
I don't think being sure that what you write is syntactically correct, and won't break on the OP's system, is being a "stickler". If using HTML formatting actually produces something incorrect when a conversion to plain text is done, that's not a nitpick, it's just wrong, and it could screw up another OP's system much worse.
I'll be most certain to make every attempt not to make use of HTML features in the future. I figured I should explain why my message unintentionally showed up with asterisks earlier, but that was a can-o-worms. :(
Perhaps, but if you saw that your message actually gave incorrect advice to the OP, you should have corrected it as soon as you saw it. It might not be in time to help the OP, but it would be in time to help other people browsing or searching the mailing list archives.
Now if Google/Gmail could let things be -- and not change my settings back to HTML from the last time I set it to plain text ... plain text is no longer an option via the webui, swell.
Plain text is the default for me on most messages, but gmail configuration is certainly offtopic for the CentOS list.
--keith
On Wed, Jan 23, 2013 at 2:37 PM, Keith Keller < kkeller@wombat.san-francisco.ca.us> wrote:
On 2013-01-23, SilverTip257 silvertip257@gmail.com wrote:
On Tue, Jan 22, 2013 at 10:24 PM, Keith Keller < kkeller@wombat.san-francisco.ca.us> wrote:
On 2013-01-22, SilverTip257 silvertip257@gmail.com wrote:
I composed with HTML and bolded */10
Some people consider it rude to use HTML on a mailing list. And, as we've just seen, it can actually be converted to something incorrect.
I realize you are likely in no way being confrontational here.
No surprise, another item for sticklers to complain about.
I don't think being sure that what you write is syntactically correct, and won't break on the OP's system, is being a "stickler". If using HTML formatting actually produces something incorrect when a conversion to plain text is done, that's not a nitpick, it's just wrong, and it could screw up another OP's system much worse.
Agreed, but in this case cron is just going to harp about it not being valid. No harm, no foul. A lesson learned (HTML nonsense) and not to be inadvertently done again if I can prevent it.
I'll be most certain to make every attempt not to make use of HTML
features
in the future. I figured I should explain why my message unintentionally showed up with asterisks earlier, but that was a can-o-worms. :(
Perhaps, but if you saw that your message actually gave incorrect advice to the OP, you should have corrected it as soon as you saw it. It might not be in time to help the OP, but it would be in time to help other people browsing or searching the mailing list archives.
On your reply I did (shown as plain text) and owned up to the botched info on account of formatting.
Now if Google/Gmail could let things be -- and not change my settings
back
to HTML from the last time I set it to plain text ... plain text is no longer an option via the webui, swell.
Plain text is the default for me on most messages, but gmail configuration is certainly offtopic for the CentOS list.
Please let this exchange back-and-forth of messages die. I bloody said why the asterisks were inserted and it was not _intentional_. I loathe that this happened because this is a total waste of your and my time.
This sets a precedence for me - read on the list and don't reply often (or at all). Sorry to all innocent bystanders.
--keith
-- kkeller@wombat.san-francisco.ca.us
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Kunle,
cron does not have the same environment as the user logged in as root. Specifically, it doesn't have the same 'PATH'. So the safest thing to do, when you refer to an executable such as 'curl' is provide the full path to the executable. If you run 'which curl' at the command prompt it will show the location of 'curl'. Probably it will be '/usr/bin/curl'. I would suggest that you modify the crontab to have the full path.
Cheers,
Cliff
On Wed, Jan 23, 2013 at 7:23 AM, Adekoya Adekunle adekunleadekoya@gmail.com wrote:
i did this from the console crontab -e
then i inserted this in my vi editor 10 * * * * curl http://mysite.com/test.php
then i exited vi
then i did crontab -l and the cron job was listed
then i did
/sbin/service crond start
and i waited for 10 mins to get a message echo to my console. the message is displayed in my browser when the php script(http://mysite.com/test.php) is loaded via my browser. The message is also shown on my console when d curl command is run direct from the console.
the problem is getting the message from the cronjob.
what could be wrong ? could it be that the job is not well setup ?
note , i logged in as root user.
please help
regards
kunle _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On 23/01/13 18:41, Cliff Pratt wrote:
cron does not have the same environment as the user logged in as root. Specifically, it doesn't have the same 'PATH'.
+1
It may also have a different selinux context. I recently discovered a logwatch setup that worked fine on C5, but parts of it were silently failing on C6. Running logwatch from cron was producing different output to running it on the command line. It took a while before it occurred to me to check selinux.
K