Skip to content
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.

SubZtep/php-cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-cron

This script is able to execute scripts, like crontab. But more often.

Please note that this script is under development.

Installation

Create log folder for log files.

Usage

Create tasks.json file to describe tasks. For example:

[
    {
        "exec": "php /var/www/cron-test/task1.php",
        "secs": 1,
        "log": "/var/log/php-cron/one.log",
        "report": "john@doe.com,jane@doe.com"
    },
    {
        "exec": "php /var/www/cron-test/task2.php",
        "secs": 3
    }
]

exec: Command to execute
secs: Number of seconds between runs
log (optional): Log file name with full path report (optional): Comma separated email address list to receive task output

How to use

It's up to you, run simply in a un*x screen is an option.

Upstream is an other option. This is just an example for more details please do some research.

For example In CentOS 6 create /etc/init/php-cron.conf with content below:

start on filesystem or runlevel [2345]
stop on shutdown
exec php /var/www/php-cron/index.php
respawn

Update exec php with your current path.

Next Steps

Find and add missing features, create proper documentation, etc :)

About

Execute commands frequently

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages