Obelisk
EN
Chapter 41 of 43Next chapter
Administration & maintenance

SSH: run jobs and send email reports

Use these commands to check scheduled work, pause it for maintenance or send a weekly or monthly report. A job is a task Obelisk runs in the background. Start with the section that matches what you need; the commands are not a sequence to run from top to bottom.

Obelisk documentation

Before copying a command

Run each command over SSH on the PBX. The examples enter /var/www/html/obelisk before starting PHP. If your site or PHP executable is elsewhere, replace those paths. Commands using sudo -u asterisk run as the application account; commands using sudo alone require administrator privileges. Run only the step that matches your problem.

These examples use the original kit in /root/obelisk-install, the site in /var/www/html/obelisk, PHP at /usr/bin/php and the FreePBX source database asteriskcdrdb. Replace any value that differs with the one chosen during installation. Keep the original kit and its journal: this private file records completed steps so that the installer can continue an interrupted operation.

Before you run a command

Connect to the PBX through SSH. The examples use /var/www/html/obelisk for the installed website and /usr/bin/php for PHP CLI. Replace those paths if your installation uses others. Run one command at a time and read its result.

Run PHP utilities from the installed website folder. Run install.sh from the extracted installation kit. sudo -u asterisk uses the Linux account that runs Obelisk; sudo alone requires administrator access. Keep passwords and API keys out of command arguments and shared logs.

  1. Open the installed website folder

    The PHP commands below use paths relative to this folder.

    Command
    cd /var/www/html/obelisk

Find out when each job runs

If a report or analysis has not run, first read the schedule actually installed on the server. The standard setup writes /etc/cron.d/obelisk. It contains six job types and seven lines because audio starts twice per minute. The table shows the initial schedule; your administrator may have changed it.

Linux cron starts application jobs. Separately, the SQL event scheduler starts the database events that process call history. The report time zone decides which dates appear in a report; changing it does not change cron’s launch time. The pause/resume commands keep existing custom schedules.

  1. Read the schedule

    This command only reads the file. Lines beginning with # are inactive. Leave the file in /etc/cron.d; do not import it with crontab.

    Command
    sudo cat /etc/cron.d/obelisk
JobDefault schedule
loggerEvery minute.
audioEvery minute, plus a second launch after 30 seconds. Locks and worker readiness can defer processing.
weeklyMonday at 06:00.
monthlyFirst day of each month at 06:00.
cleanerDaily at 03:30, with --apply; the separate cleanup setting must allow deletion.
retentionDaily at 04:00, with --apply; the separate audio-retention setting must allow deletion.
min_queue / min_out (SQL)Each every 15 minutes in the database, staggered by 7 minutes 30 seconds in the supplied definitions. These are not additional Linux cron jobs.

Choose which period the email should cover

Weekly and monthly reports summarize recording analyses already saved in Obelisk. They do not first analyze all recordings waiting in the queue. Before sending, check AI, SMTP sender, REPORT_EMAIL_TO recipients, report language and time zone in System and utilities.

Use the table to choose the command. Then run its preview and read the actual start and end dates. This matters when resending later: the command selects its period at the time you run it.

Tool / operationWhich dates it uses
weeklyPrevious complete Monday–Sunday week, calculated at execution time in the configured PBX/report zone. Running it next week changes the selected week.
monthlyPrevious complete calendar month. It is not a rolling last-30-days report.
Monthly report with the --test optionLast 30 calendar days including today. Without --dry-run it requests AI and sends email to the real configured recipients. It is not a safe SMTP-only test.
Daily or arbitrary past periodThere is no supported daily email worker or CLI date-range option. Use the date selection in Quality & AI for an on-demand review, or agree a different email workflow with Obelisk support. Do not rename a worker or change the server clock.

Check whether there is enough data before sending

Run the weekly or monthly command below. --dry-run shows the selected period and the available analyses without generating AI text or sending email. Read eligible to see whether the report has enough usable data.

If there is not enough data, check the missing dates or incomplete analyses before trying a real send. A successful preview does not test Gemini or SMTP and does not prove that the scheduled job ran.

  1. Preview the weekly report

    Read period, time zone, summaries, minimum_summaries, coverage and eligible. Unknown call dates and incomplete analyses can reduce the usable sample.

    Command
    cd /var/www/html/obelisk &&
    sudo -u asterisk /usr/bin/php cron_weekly_trends.php --dry-run
  2. Preview the monthly report

    Read valid_calls, minimum_calls and eligible. The monthly minimum is 10 usable calls. The output identifies the actual period; do not infer it from the command date alone.

    Command
    cd /var/www/html/obelisk &&
    sudo -u asterisk /usr/bin/php cron_monthly_report.php --dry-run
  3. Optional: preview the last 30 days

    Use this only if you want the last 30 calendar days instead of the previous calendar month. Keep --dry-run: without it, --test still generates AI analysis and sends email to the real recipients. Read the preview before considering an actual send.

    Command
    cd /var/www/html/obelisk &&
    sudo -u asterisk /usr/bin/php cron_monthly_report.php --test --dry-run

Send the report once and check the mailbox

After checking the preview, make sure the report has not already been delivered. Run either the weekly or monthly command. It can use Gemini quota and send to the recipients currently configured in Obelisk. It does not change the schedule.

Wait for the command to finish. If it says it skipped the report, read why: insufficient data, missing settings or another run already in progress are not successful sends. Check the final log and the recipient’s inbox.

  1. Generate the weekly report

    Wait for completion and read the final AI/SMTP result. A configuration skip, insufficient-data message or already-running lock is not an email delivery.

    Command
    cd /var/www/html/obelisk &&
    sudo -u asterisk /usr/bin/php cron_weekly_trends.php
  2. Generate the monthly report

    Use this for the previous calendar month. Do not add --test merely because you are troubleshooting: that option changes the reporting window and still sends email.

    Command
    cd /var/www/html/obelisk &&
    sudo -u asterisk /usr/bin/php cron_monthly_report.php
  3. Verify the final outcome

    Check the command exit status immediately, then the log, Administration job observation and mailbox. Exit 0 alone can also mean an intentional skip. SMTP success means server acceptance, not proof that the message reached the inbox. Inspect spam/quarantine or mail-server traces when needed.

    Command
    echo $?

The job did not do what you expected: read its log

The command below prints the weekly job’s log path without running that job. Replace weekly with monthly, audio, logger, cleaner or retention to find another log.

Open the indicated file and read the most recent run through to its final message. The log location depends on installation settings. Before sending an extract to support, remove email addresses, passwords and private server details. The table helps distinguish the jobs: running one is not a way to test another.

  1. Find the log file

    This only prints where the log is stored; it does not generate a report.

    Command
    cd /var/www/html/obelisk &&
    sudo -u asterisk /usr/bin/php cron_run.php --log-path weekly
Tool / operationWhen to use it and what changes
audio / loggeraudio analyzes eligible recordings and can call Gemini. logger collects live/history data and can send pending security alerts. Neither sends a daily report; do not run them just to see whether PHP works.
weekly / monthlyGenerate the AI/email reports described above. They need sufficient saved data, valid settings and a suitable license. A busy run prevents another simultaneous run, but starting again later can send the report twice.
cleaner / retentionDelete recordings by category or age. No arguments or --dry-run shows what would be deleted. Actual deletion needs --apply and the relevant deletion setting enabled. These commands do not repair call reports.

Jobs stopped when the license expired

Check the license before editing cron. When a trial or time-limited license expires, AI analysis, logger and periodic reports wait for renewal. Their schedule entries stay in place; after renewal, processing can resume when the usual requirements are met.

SQL imports, technical maintenance and security alerts continue. Cleaner and retention can also continue deleting recordings if their deletion settings are enabled. Check those settings separately: an expired license does not suspend every job.

Request your demo

The complete Obelisk experience. Tell us about your contact center.

Loading the request form…