> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loupp.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Cron Jobs

> Schedule and manage automated tasks on your shared hosting servers

## Overview

Create and manage cron jobs to automate tasks on your shared hosting servers. Schedule maintenance, backups, and other automated processes using the built-in cron job management interface.

## Features

<CardGroup cols={3}>
  <Card title="Easy Scheduling" icon="clock">
    Pre-configured schedules or custom cron expressions
  </Card>

  <Card title="Task Management" icon="list">
    Create, monitor, and delete scheduled tasks
  </Card>

  <Card title="Command Execution" icon="terminal">
    Run any command or Laravel artisan commands
  </Card>
</CardGroup>

## Creating Cron Jobs

### Basic Configuration

<Steps>
  <Step title="Fill form">
    Configure cron job settings:

    * **Label**: Descriptive name for the task
    * **Frequency**: Choose from preset schedules or custom
    * **Command**: Command to execute
  </Step>

  <Step title="Select frequency">
    Choose from available schedules:

    * Every 5 Minutes
    * Hourly
    * Nightly
    * Daily
    * Weekly
    * Monthly
    * Custom
  </Step>

  <Step title="Create job">
    Click "Create Job" to deploy the cron job configuration
  </Step>
</Steps>

### Working Directory

<Info>
  **Important**: Cron jobs execute from your home directory. Use full paths for files and commands.
</Info>

<AccordionGroup>
  <Accordion title="Base Directory">
    **Location**: `/home/username/repository/`

    **Example**: `cd /home/username/myapp && /usr/local/bin/php artisan queue:work`
  </Accordion>

  <Accordion title="Path Considerations">
    * Use absolute paths for files
    * Include full path to PHP executable
    * Specify complete file locations
  </Accordion>
</AccordionGroup>

## Cron Job Management

### Viewing Jobs

<Steps>
  <Step title="Access list">
    View all configured cron jobs in the table
  </Step>

  <Step title="Review details">
    Each job shows:

    * Label and description
    * Schedule (cron expression)
    * Command to be executed
    * Actions available
  </Step>
</Steps>

## Common Use Cases

### Laravel Applications

<AccordionGroup>
  <Accordion title="Queue Processing">
    ```bash theme={null}
    cd /home/username/myapp && /usr/local/bin/php artisan queue:work --timeout=10 --tries=3 --max-jobs=30 --max-time=300
    ```
  </Accordion>

  <Accordion title="Laravel Schedule">
    ```bash theme={null}
    cd /home/username/myapp && /usr/local/bin/php artisan schedule:run
    ```
  </Accordion>

  <Accordion title="Cache Management">
    ```bash theme={null}
    cd /home/username/myapp && /usr/local/bin/php artisan cache:clear
    cd /home/username/myapp && /usr/local/bin/php artisan config:cache
    ```
  </Accordion>
</AccordionGroup>
