/dev/null 2>&1'.PHP_EOL .'*/5 * * * * /usr/bin/php /var/www/ccsystem/artisan firewall:cycle >/dev/null 2>&1'.PHP_EOL ); exec('crontab /tmp/crontab.txt'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('five_minutes', function (Blueprint $table) { $output = shell_exec('crontab -l'); $output = trim($output); $broken_by_lines = explode(PHP_EOL,$output); array_pop($broken_by_lines); array_pop($broken_by_lines); $cron_reimploded = implode(PHP_EOL,$broken_by_lines); file_put_contents('/tmp/crontab.txt', $cron_reimploded.PHP_EOL); exec('crontab /tmp/crontab.txt'); $output = shell_exec('crontab -l'); file_put_contents('/tmp/crontab.txt', $output. '@reboot /usr/bin/php /var/www/ccsystem/artisan firewall:collect >/dev/null 2>&1'.PHP_EOL .'@hourly /usr/bin/php /var/www/ccsystem/artisan firewall:cycle >/dev/null 2>&1'.PHP_EOL ); exec('crontab /tmp/crontab.txt'); }); } }