Scheduled Tasks

Textstem adds its housekeeping commands to Laravel's scheduler itself. You don't list them in your own schedule, but the host app needs the scheduler running, from cron, every minute:

* * * * * cd /path-to-your-site && php artisan schedule:run >> /dev/null 2>&1

Without it, nothing below runs. Scheduled publishing (content approval) needs it most: a page scheduled for 9:00 goes live at the first schedule:run after that time.

What runs

Command When Condition Does
textstem:publish-due Every minute Always Publishes scheduled pages and posts that are due
textstem:health-check Daily, 01:00 Always Checks the database, cache, storage, disk space and PHP version
cache:manage clear --warm-up Mondays, 01:30 Always Clears the caches and warms them up again
textstem:prune-reports Daily, 03:00 Always Removes SEO and accessibility reports past their retention
textstem:prune-events Mondays, 03:30 Always Removes activity log entries older than events.retention_days (90)
forms:prune-submissions Daily, 03:45 FORMS_ENABLED=true Removes form answers past their retention, and long-deleted ones
textstem:clear-idle-drafts Daily, 04:00 Always Clears drafts of live pages and posts idle for TEXTSTEM_APPROVALS_COPY_DAYS (90) days
textstem:security-audit Daily or weekly (Wednesdays) Turned on in Tools → Security Audit Checks dependencies and server versions for known CVEs

publish-due, clear-idle-drafts and forms:prune-submissions don't overlap: a run that is still going when the next one is due makes the next one skip.

Known issue: the security audit's time setting is ignored and it runs at 00:00 on its days.

Tools → Schedule Monitor in the admin shows the schedule and when each task last ran.

Not scheduled for you

  • The sitemap. textstem:sitemap:generate isn't scheduled. Add it if you want a daily sitemap:

    // routes/console.php (Laravel 11+)
    use Illuminate\Support\Facades\Schedule;
    
    Schedule::command('textstem:sitemap:generate')->dailyAt('02:00');
    
  • Health check emails. The scheduled health check runs without --notify. Schedule textstem:health-check --notify yourself to be emailed when it fails.

  • Queue workers. The scheduler doesn't start workers. Keep php artisan queue:work running under Supervisor or similar; see Queues.

php artisan textstem:maintenance-schedule prints further suggestions, such as retrying failed jobs weekly and cleaning old logs and backups.

esc