# Cron Installation Without Server Access

**Last Updated:** 2026-03-06

Quick reference for installing the HubSpot sync cron job when you don't have direct server access. **No server configuration required** - works immediately after deployment.

## ⭐ Recommended Solution: GitHub Actions (Easiest)

**Time:** 2 minutes | **Difficulty:** Easy | **No server access required** | **No external services needed**

### Quick Steps

1. **Add GitHub Secret** (one-time setup):
   - Go to: **Settings** → **Secrets and variables** → **Actions**
   - Click **New repository secret**
   - Name: `CRON_WEBHOOK_SECRET`
   - Value: `cf5a877749d9c94e4d6c0bfee780d73b` (hardcoded token from config file)
   - Click **Add secret**

2. **Workflow is already created** - `.github/workflows/hubspot-sync-cron.yml` is included in the repository

3. **Verify it's working:**
   - Go to **Actions** tab
   - Select **HubSpot Sync Cron** workflow
   - Click **Run workflow** → **Run workflow** (manual test)
   - Check logs to verify success

**Done!** The sync will run automatically every hour. No server configuration needed.

See [GITHUB_SECRETS_SETUP.md](GITHUB_SECRETS_SETUP.md) for detailed setup instructions.

## Alternative: External Cron Service (Webhook)

If you prefer using an external cron service instead of GitHub Actions:

**Time:** 3 minutes | **No server access required**

### Quick Steps

1. **Sign up for cron-job.org** (free): https://cron-job.org

2. **Create cron job:**
   - URL: `https://www.ordio.com/v2/api/cron-webhook-sync.php?token=cf5a877749d9c94e4d6c0bfee780d73b`
   - Schedule: Every hour (`0 * * * *`)
   - Method: GET
   - Timeout: 600 seconds

3. **Test:**
   ```bash
   curl "https://www.ordio.com/v2/api/cron-webhook-sync.php?token=cf5a877749d9c94e4d6c0bfee780d73b"
   ```

**Done!** The sync will run automatically every hour.

**Note:** The token (`cf5a877749d9c94e4d6c0bfee780d73b`) is hardcoded in `v2/config/cron-webhook-config.php`, so no server configuration is needed.

## Other Options

- **Hosting Control Panel:** Use cPanel/Plesk cron interface (see [CRON_INSTALLATION.md](CRON_INSTALLATION.md))
- **Email Server Admin:** Send installation instructions (see [CRON_INSTALLATION_EMAIL_TEMPLATE.txt](CRON_INSTALLATION_EMAIL_TEMPLATE.txt))
- **Automatic via Deployment:** GitHub Actions deployment attempts cron installation automatically (non-blocking)

## Full Documentation

- **[WEBHOOK_CRON_SETUP.md](WEBHOOK_CRON_SETUP.md)** - Detailed webhook setup guide
- **[CRON_INSTALLATION.md](CRON_INSTALLATION.md)** - Complete installation guide with all methods
- **[CRON_SYNC_RUNBOOK.md](CRON_SYNC_RUNBOOK.md)** - Operational runbook

## Need Help?

- **Webhook returns 401:** Token mismatch - verify token in URL matches hardcoded token in `v2/config/cron-webhook-config.php`
- **Webhook returns 429:** Rate limit (max 1 per 5 minutes) - wait and retry
- **GitHub Actions not running:** Check workflow is enabled in repository settings
- **Webhook not being called:** Check external cron service logs/dashboard or GitHub Actions workflow runs
- **Sync not updating:** Check server PHP error logs for sync errors (if you have access)
