@extends('layouts.app') @section('title', 'Auto Isolir Scripts') @section('content')

Auto Isolir Scripts

Cronjob scripts untuk cPanel, aaPanel, dan Windows

@php $detectedPlatform = 'Unknown'; $appPath = base_path(); if (isset($_SERVER['SERVER_SOFTWARE'])) { $serverSoftware = strtolower($_SERVER['SERVER_SOFTWARE']); if (strpos($serverSoftware, 'apache') !== false && (strpos($appPath, '/home/') !== false || strpos($appPath, '/public_html/') !== false)) { $detectedPlatform = 'cPanel'; } elseif (strpos($serverSoftware, 'nginx') !== false || strpos($appPath, '/www/wwwroot/') !== false) { $detectedPlatform = 'aaPanel'; } elseif (strpos($appPath, 'C:\\xampp') !== false || strpos($appPath, 'C:/xampp') !== false) { $detectedPlatform = 'Windows XAMPP'; } } @endphp @if($detectedPlatform !== 'Unknown')
Platform Terdeteksi: {{ $detectedPlatform }} - Script yang direkomendasikan untuk platform Anda sudah di-highlight di bawah.
@endif
cPanel Cronjob @if($detectedPlatform === 'cPanel') RECOMMENDED @endif
# Auto Isolir Check (setiap 6 jam)
0 */6 * * * {{ strpos(base_path(), '/home/') !== false ? '/usr/local/bin/php ' . base_path() : '/usr/local/bin/php /home/username/public_html' }}/artisan auto-isolir:check

# Queue Worker (setiap menit)
* * * * * {{ strpos(base_path(), '/home/') !== false ? '/usr/local/bin/php ' . base_path() : '/usr/local/bin/php /home/username/public_html' }}/artisan queue:work database --stop-when-empty --timeout=240

# Queue Restart (setiap jam)
0 * * * * {{ strpos(base_path(), '/home/') !== false ? '/usr/local/bin/php ' . base_path() : '/usr/local/bin/php /home/username/public_html' }}/artisan queue:restart
@if($detectedPlatform === 'cPanel') Script ini cocok untuk platform Anda @endif
aaPanel Cronjob @if($detectedPlatform === 'aaPanel') RECOMMENDED @endif
# Auto Isolir Check (setiap 6 jam)
0 */6 * * * {{ strpos(base_path(), '/www/wwwroot/') !== false ? '/usr/bin/php ' . base_path() : '/usr/bin/php /www/wwwroot/domain.com' }}/artisan auto-isolir:check

# Queue Worker (setiap menit)
* * * * * {{ strpos(base_path(), '/www/wwwroot/') !== false ? '/usr/bin/php ' . base_path() : '/usr/bin/php /www/wwwroot/domain.com' }}/artisan queue:work database --stop-when-empty --timeout=240

# Queue Restart (setiap jam)
0 * * * * {{ strpos(base_path(), '/www/wwwroot/') !== false ? '/usr/bin/php ' . base_path() : '/usr/bin/php /www/wwwroot/domain.com' }}/artisan queue:restart
@if($detectedPlatform === 'aaPanel') Script ini cocok untuk platform Anda @endif
Windows Task Scheduler @if($detectedPlatform === 'Windows XAMPP') RECOMMENDED @endif
# Task 1: Auto Isolir Check
Program: {{ strpos(base_path(), 'C:') !== false ? 'C:\\xampp\\php\\php.exe' : 'C:\\xampp\\php\\php.exe' }}
Arguments: {{ str_replace('/', '\\', base_path()) }}\\artisan auto-isolir:check
Trigger: Daily, repeat every 6 hours

# Task 2: Queue Worker
Program: {{ strpos(base_path(), 'C:') !== false ? 'C:\\xampp\\php\\php.exe' : 'C:\\xampp\\php\\php.exe' }}
Arguments: {{ str_replace('/', '\\', base_path()) }}\\artisan queue:work database --stop-when-empty --timeout=240
Trigger: Daily, repeat every 1 minute
@if($detectedPlatform === 'Windows XAMPP') Script ini cocok untuk platform Anda @endif
Maintenance Script
# Daily maintenance (run at 2 AM)
0 2 * * * {{ $detectedPlatform === 'cPanel' ? '/usr/local/bin/php' : '/usr/bin/php' }} {{ base_path() }}/artisan optimize:clear
0 2 * * * {{ $detectedPlatform === 'cPanel' ? '/usr/local/bin/php' : '/usr/bin/php' }} {{ base_path() }}/artisan cache:clear
0 2 * * * {{ $detectedPlatform === 'cPanel' ? '/usr/local/bin/php' : '/usr/bin/php' }} {{ base_path() }}/artisan queue:prune-failed --hours=24
Platform Information
Detected Platform:
{{ $detectedPlatform }}
App Path:
{{ base_path() }}
Server Software:
{{ $_SERVER['SERVER_SOFTWARE'] ?? 'Unknown' }}
@endsection