Cron & Scheduler
Laravel Scheduler allows you to define scheduled tasks in code rather than in the crontab.
Cron configuration
Section titled “Cron configuration”Add a single cron entry to run the Laravel scheduler:
* * * * * cd /var/www/xetasuite-core && php artisan schedule:run >> /dev/null 2>&1crontab -eAdd the line above.
- Go to Servers → your server
- Click on Scheduler
- Check Enable Scheduler for the site
XetaSuite scheduled tasks
Section titled “XetaSuite scheduled tasks”Tasks are defined in routes/console.php:
use Illuminate\Support\Facades\Schedule;
// Clean expired sessionsSchedule::command('session:gc')->daily();
// Prune old failed jobsSchedule::command('queue:prune-failed --hours=48')->daily();
// Daily backupSchedule::command('backup:run')->dailyAt('02:00');
// Clean old backupsSchedule::command('backup:clean')->dailyAt('03:00');Useful commands
Section titled “Useful commands”View scheduled tasks
Section titled “View scheduled tasks”php artisan schedule:listManually run the scheduler
Section titled “Manually run the scheduler”php artisan schedule:runRun a specific command
Section titled “Run a specific command”php artisan backup:runBackups
Section titled “Backups”Configuration
Section titled “Configuration”Edit config/backup.php:
'backup' => [ 'name' => env('APP_NAME', 'xetasuite'), 'source' => [ 'files' => [ 'include' => [base_path()], 'exclude' => [ base_path('vendor'), base_path('node_modules'), ], ], 'databases' => ['pgsql'], ], 'destination' => [ 'disks' => ['s3'], // or 'local' ],],Available commands
Section titled “Available commands”# Run backupphp artisan backup:run
# Run backup (database only)php artisan backup:run --only-db
# List backupsphp artisan backup:list
# Clean old backupsphp artisan backup:cleanMonitoring
Section titled “Monitoring”Check scheduler is running
Section titled “Check scheduler is running”php artisan schedule:listView logs
Section titled “View logs”tail -f storage/logs/laravel.logFailed jobs
Section titled “Failed jobs”php artisan queue:failed