How to Find Which Accounts have Cron jobs added

kodeslogic

Well-Known Member
Apr 26, 2020
334
128
118
IN
cPanel Access Level
Root Administrator
You can create a script to fetch list of all cronjobs..

1. SSH your server with root user

2. Create a file "getcronlist.sh" with following code into this file:

Code:
#!/bin/bash
cd /var/spool/cron
ls -1 > /root/userscronjobs.txt
for i in `cat /root/userscronjobs.txt`
 do
  echo "######For the user $i######" >> /root/cron_list.txt
  echo "" >> /root/cron_list.txt
  cat $i >> /root/cron_list.txt
  echo "" >> /root/cron_list.txt
  echo "###########################" >> /root/cron_list.txt
  echo "" >> /root/cron_list.txt
 done
3. Execute "getcronlist.sh"
Code:
./getcronlist.sh
4. Now you can view the result from "/root/cron_list.txt"
Code:
cat /root/cron_list.txt
 
  • Like
Reactions: Michael-Inet