Process Management & Cron Job Monitoring
⚙️ Monitor Running Jobs & Processes
| Command | Description |
|---|---|
ps aux |
List all running processes with user, CPU, memory |
ps -ef |
Full-format listing of all processes |
top |
Interactive real-time process viewer |
htop |
Enhanced top view (install: sudo apt install htop) |
pgrep -a php |
List all running PHP processes with command line |
pgrep -fa 'php.*processStockSync' |
Search PHP processes running processStockSync |
ps aux | grep php |
List all running PHP processes |
ps aux | grep processStockSync |
Search PHP processes running processStockSync |
⏰ Cron Jobs (Scheduling Tasks)
| Command | Description |
|---|---|
crontab -l |
List current user’s cron jobs |
crontab -e |
Edit current user’s cron table |
sudo crontab -l -u www-data |
List cron jobs for a specific user |
sudo crontab -e -u username |
Edit crontab of another user |
grep CRON /var/log/syslog |
View system log for executed cron jobs |
| sudo journalctl -u cron --since "2025-11-12 06:00:00" --until "2025-11-12 07:00:00" | grep "mrsaliceouterspace.bsol40105.com" | view system log including cron job for given date and time and domain |
journalctl -u cron |
View cron service logs (systemd systems) |
tail -f /var/log/syslog |
Live view of system log (cron included) |
grep '/path/to/script.php' /var/log/syslog |
Filter log for specific job run |
* * * * * php /script.php >> /log.log 2>&1 |
Cron example: Run every minute and log output |
❌ Kill Running Jobs & Processes
| Command | Description |
|---|---|
kill <PID> |
Gracefully stop a process by PID |
kill -9 <PID> |
Force kill a process immediately (SIGKILL) |
pkill php |
Kill all PHP processes |
pkill -f "php /path/to/index.php" |
Kill PHP process matching exact command |
killall php |
Kill all processes with name php |
| `ps aux | grep php` |
htop → F9 |
Use htop to interactively kill a selected process |
xkill |
Click on a GUI window to kill it (requires GUI + sudo apt install x11-utils) |
No comments to display
No comments to display