PHPCronManager
Preface
I tried to make this as simplest. So There's no handling about some danger commands(e.g : rm -rf [somethings], halt, reboot, shutdown, and so on... )
So I want you to be careful when you use this class. I've no responsibility about problems occurred by using this class.
Description
Be made to approach linux's cron system. Cronjobs are made by this class, managed by CRONTAG. CRONTAG is a comment that pasted cronjob's tail.
Test Environment
OS : CentOS 6.8 (Final)
php : PHP 7.0.16
And understandably crond installed.
Update Note
- v1.01(2018-12-20)
- function add_cronjob's command changed more safety.
- v1.00(2018-11-10)
- uploaded
e.g (assume u to load this file completely)
$cron_manager = new CronManager()
$cron_add_result = $cron_manager->add_cronjob('* * * * * date >> /var/testdir/datelog.txt 2>&1', 'datelog');
//if this codes worked normally, u will get array return with
…