Skip to content

Monitoring Maintenance Tasks

Maintenance tasks include log rotation, cache cleanup, temp file deletion, and other housekeeping scripts. When these fail silently, disk fills up, performance degrades, or systems eventually crash.

Set your API key as an environment variable. For cron jobs, add it to your crontab:

Terminal window
# Edit crontab
crontab -e
# Add at top of crontab
PAKYAS_API_KEY=pk_live_xxxxx
# Then your cleanup job
0 4 * * * pakyas monitor cleanup-task -- /scripts/cleanup.sh

Or source from a file:

Terminal window
0 4 * * * . ~/.pakyas_env && pakyas monitor cleanup-task -- /scripts/cleanup.sh

See Environment Variables for all options.

  • Maintenance runs on a schedule
  • Skipped maintenance causes cascading problems
  • Failures often go unnoticed until something breaks
Terminal window
pakyas monitor cleanup-task -- ./cleanup.sh

Pakyas wraps your maintenance script and alerts you immediately if it fails or doesn’t run.

Terminal window
# crontab example - runs every day at 4am
0 4 * * * pakyas monitor cleanup-task -- /scripts/cleanup.sh
  • Cleanup script exits non-zero
  • Script runs longer than expected
  • Script never runs (missed schedule)