Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marioblazek/crontab-manager

Crontab Manager library
https://github.com/marioblazek/crontab-manager

Last synced: 3 days ago
JSON representation

Crontab Manager library

Awesome Lists containing this project

README

        

# Q Alliance / Crontab Manager

### Installation:
```bash
$ composer require q-alliance/crontab-manager
```

### Usage:
* create a reader, send username as parameter (use common sense, you cannot set root crontab if you are running this as joeaverage user)
* create a writer and inject the reader
* run update with array of cron jobs to add

##### for example:

```php
updateManagedCrontab($cronJobs);
```
* all users current cron jobs will be left intact
* a new `block` of cron jobs will be added to crontab, using the list provided
* this block is managed by this library - if you add or remove jobs from the array, they will be updated when you run the updateMangedCrontab method
* also see [example.php](example.php) in the root folder

### Misc & TODO:
* tests
* create a symfony bundle to integrate this with Symfony 4 framework
* CLI command that can be run via composer install to auto-update your crontabs with every new release