Skip to content

Commit c6ee6c3

Browse files
Add Readme
1 parent e6cebbb commit c6ee6c3

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# README #
2+
3+
### What is this repository for? ###
4+
Php-cli app to check the status code of an URL.
5+
6+
If the status code is 200 the url works; otherwise, the app will send a message to the list of emails.
7+
8+
Any configuration about email account and emails list are placed in `inc/conf.php` file.
9+
10+
### How do I get set up? ###
11+
12+
Clone repository and manage dependencies with composer:
13+
14+
* $ `git clone https://github.com/marlenesco/URL-Health-Check.git`
15+
* $ `composer install`
16+
17+
### How it works? ###
18+
19+
It works via Command Line Interface (php-cli), exec the following command:
20+
21+
`php index.php -uhttps://www.google.com`
22+
23+
### Crontab ###
24+
25+
Setting up a crontab:
26+
27+
$ `crontab -e`
28+
29+
In crontab editor insert the following line:
30+
31+
`*/5 * * * * /usr/local/bin/php /{Application-Path}/index.php -u{URL-TO-CHECK}`
32+
33+
* Check your php installation directory (/usr/local/bin/php in above case).
34+
* Replace `{Application-Path}` with your application installation directory.
35+
* Replace `{URL-TO-CHECK}` with a valid URL to check.
36+
37+
You can check more URLs in your crontab job:
38+
39+
`*/5 * * * * /usr/local/bin/php /{Application-Path}/index.php -u{URL-TO-CHECK}`
40+
41+
`*/5 * * * * /usr/local/bin/php /{Application-Path}/index.php -u{ANOTHER-URL-TO-CHECK}`
42+
43+
In this case, `*/5 * * * *` every 5 minutes meaning.
44+
45+
You can see more information about "how to generate the Crontab command" in [Crontab Generator](https://crontab-generator.org/) page.

0 commit comments

Comments
 (0)