View Categories

Useful commands

2 min read

Requirements & quick checks

Check PHP CLI timezone

php -r "echo date_default_timezone_get(), PHP_EOL;"

Per-server identity (required in multi-server)
In each server’s .env.local:

APP_SERVER_NAME=web-1 # e.g. web-1, worker-a, fr-par-02

Multi-server health & replication

Crontab (on every server)

# Report this server's status every minute (internally every 3 min)
* * * * * php /path/to/app/bin/console eac:server-status --every=3

# Daily purge of old server statuses (keep last 4 days)
30 1 * * * php /path/to/app/bin/console eac:server-status:purge --days=4

Job version replication checks

# Incremental check (new/different only) — runs every minute
* * * * * php /path/to/app/bin/console eac:check-jobversion-deployment

# Full comparison once per day (force a full pass)
0 2 * * * php /path/to/app/bin/console eac:check-jobversion-deployment --force

What they do

  • eac:server-status: pushes a heartbeat for each node so the UI can display live server health.
  • eac:server-status:purge: cleans old heartbeats.
  • eac:check-jobversion-deployment: verifies that ETL packages are replicated on all slave servers (incremental or full with --force).

Scheduler (EAC built-in)

Resolution: supports sub-minute plans (down to seconds), unlike system crontab.
Activation: a plan can be switched on/off from the UI or bounded by start/end dates.

Run the scheduler loop

# Launch the scheduler engine every minute
* * * * * php /path/to/app/bin/console eac:scheduler

Gate via environment variable

  • Tasks are triggered only if: SCHEDULE_ENABLED=true
  • The Start/Stop Scheduler button in the UI flips this variable instantly (no redeploy, no crontab change).

Tip: In the task list, the Active now indicator turns true only when a run is due within the look-ahead window. A future schedule (e.g., Friday) will show false until the due time approaches.


Background process hygiene

  • Check & clean background tasks # Example: sanity check every 5 minutes */5 * * * * php /path/to/app/bin/console eac:check-background-task Kills stale background jobs when necessary.
  • Upgrade helper (1.6 → 1.7) php bin/console eac:clean-jobversion

ETL logs, stats & metrics

Configure your ETL studio

File > Change project properties > Job parameters > Stat and logs

Choose “save logs in database”.

Enable logs in EAC

In .env.local:

APP_ENABLE_ETL_LOGS=true

# Connection string to the ETL logs database (MySQL, Postgres, Oracle, SQLite, MariaDB supported)
# Examples:
# DATABASE_URL_ETL_LOG="mysql://user:pass@127.0.0.1:3306/etl_logs?charset=utf8mb4"
# DATABASE_URL_ETL_LOG="postgresql://user:pass@127.0.0.1:5432/etl_logs"
DATABASE_URL_ETL_LOG="postgresql://user:pass@host:5432/etl_logs"

# Table names
ETL_STAT_TABLE_NAME=etl_stats
ETL_MET_TABLE_NAME=etl_metrics
ETL_LOG_TABLE_NAME=etl_logs

Emit the root PID from your ETL job

In your main job (e.g., a tJava):

System.out.println("@@eac@@root_pid=" + rootPid);

ETL log purging (keep storage & UI fast)

You can trigger purges manually in the task page or schedule them (Task details → Cron schedulingAdd scheduler, Task type = purge).

Modes

  • By date: delete logs before a fixed date (e.g., “< 2025-07-01”).
  • By history: keep only the last X runs (e.g., last 100).
  • By duration: delete runs faster than Y seconds with status Success/Warning (e.g., < 30s).
  • Multiple purges can coexist (e.g., keep last 100 and also drop very short runs).

One-glance crontab template

# --- EAC core ---
* * * * * php /path/to/app/bin/console eac:scheduler
* * * * * php /path/to/app/bin/console eac:server-status --every=3
30 1 * * * php /path/to/app/bin/console eac:server-status:purge --days=4

# --- Replication checks ---
* * * * * php /path/to/app/bin/console eac:check-jobversion-deployment
0 2 * * * php /path/to/app/bin/console eac:check-jobversion-deployment --force

# --- Background hygiene ---
*/5 * * * * php /path/to/app/bin/console eac:check-background-task

Replace /path/to/app with your actual project root (the path that contains bin/console).