Con Jobs visit URL ? - cron

How can I do an with jobs to visit a complete web ? It is possible to
thanks

You definitely can. You can utilize the cURL plugin that generally comes with cPanel servers.
cURL Cron Format:
curl --request GET 'https://www.example.com/path/to/myWebsite.php?TestParam=Hello%20World!'
You can find more information on this here: Visit URL Via Cron Job.

Related

Unable to use wget for downloading git hub search results

I am trying to use wget to download github code search results into a logfile.
I've been using the following command :
wget -o logfile -r -l 2 https://github.com/search?l=Dockerfile&q=openjdk&type=Code&utf8=%E2%9C%93
I do however, get a robots.txt file that says the following :
# If you would like to crawl GitHub contact us at support#github.com.
# We also provide an extensive API: https://developer.github.com/
Do I need some sort of permission from github for this?
Can someone help?
I think the message is pretty clear: you're trying to crawl GitHub site and they don't like that.
They advise you to use the GraphQL API.
The v3 API is still REST, so you could do something like:
wget --output-document search-results.json --user <YOUR_GITHUB_ID> \
"https://api.github.com/search/code?q=openjdk+language:Dockerfile"

How does Kong Api Gateway http-log works

As per Kong documentation
**
$ curl -X POST http://kong:8001/apis/{api}/plugins \
--data "name=http-log" \
--data "config.http_endpoint=http://mockbin.org/bin/:id/" \
--data "config.method=POST" \
--data "config.timeout=1000" \
--data "config.keepalive=1000"
**
log will be create at http_endpoint.
I am unable to understand how does kong http-log works.
Suppose my request host is x.x.x.x and kong in installed in my local system,where should i look for log generated after adding http-log plugin.is http-log is accessible using console?
You have to create a listener on the location which is specified as config.http_endpoint. Endpoint has to handle config.method. It will receive a big JSON with all the log info in it.
Check example log JSON at click here
My Suggestion:
Best option here is to set this end point to the elastic search end point to receive all your logs and use Kibana UI on top of elastic to add the visualization to your log data.
HTTP Log -
Send request and response logs to an HTTP server.
the config.http_endpoint is your log server where you can view your logs

How to set cron in cakephp in cpanel on linux server

How do i set the cron command in Cpanel in Linux server i use this it works for me is there any proper way
wget http://www.vloghit.com/crons/send_mail
You should use the full path for wget like /usr/bin/wget instead of just plain wget. Depending on the WHM server configuration the crons might be running as jailed so you might get an error stating that wget command was not found if you do not use the full path to the binary. You are also supposed to receive an email notification from that cron job. Are you geting it? I'm asking because in those email notifications you get also an error message that can help you to understand why the cron was not working.

File path for a Cron Job

Hi I want to run a cron job to call a PHP script on my server. I am using Cpanel from my web host and these are the options:
Minute:
Hour:
Day:
Month:
Weekday:
Command:
I am really struggling to point the command to my file I am using this line /home/abbeysof/public_html/adi/cron/daily.php but I am getting this error:
/bin/sh: /home/abbeysof/public_html/adi/cron/daily.php: Permission denied
I asked my web host for help and this is the response:
If you use cpanel to create it, it will fill in the path for you. Typically /home/username/public_html/etc
Can anyone please offer some advice?
Advise 1: use wget command, wget runs the PHP script exactly as if it was called from the web so the PHP environment is exactly the same of when calling the file from the web, it's easier to debug your script then.
wget -O - http://yourdomain.com/adi/cron/daily.php >/dev/null 2>&1
The cron jobs has to be created going into cPanel cron jobs menu. I don't understand if you have this clear by reading your hoster's answer.
And advise 2: change web hosting, try this one they don't leave you alone.
Sorry, I don't know anything about cpanel, but it sounds like:
if you created the file daily.php, then you need to change the permissions on it
if they created the file, then there's a bug in their creation routine.
Good luck!
try this one
/usr/bin/php -q /home/yourCpanelUsername/public_html/filename.php
for some cpanels it might be like this
/usr/local/bin/php -q /home/yourCpanelUsername/public_html/filename.php
Sounds like you need to make /home/abbeysof/public_html/adi/cron/daily.php executable.
The link might help you.
https://www.inmotionhosting.com/support/edu/cpanel/how-to-run-a-cron-job
There is difference if you are using VPS than sharing hosting for giving the command.
You may need to use user-agent & cPanel-Cron along with your url.
curl --user-agent cPanel-Cron http://example.com/cron.php

How can I test my browser ignoring Location headers?

I want to test a site with my Firefox ignoring Location: headers like this example in PHP.
header('Location: another-page.php');
Is there a plugin available to do this, or any other method?
Would my best bet be surfing the site with Lynx? Does Lynx ignore them?
Thanks
You could try bringing up the pages with cURL.
It is a command line application that is invoked via:
curl http://url
cURL does not follow Location: headers by default.

Resources