How to Find Which Accounts have Cron jobs added
Hello, I have too much cpanels it's running too much crons so server load is increasing.
I want to know that how can I get a list of CPanel accounts which have Cron jobs added ?
-
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: #!/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"./getcronlist.sh
4. Now you can view the result from "/root/cron_list.txt"cat /root/cron_list.txt
0 -
Let us know if @kodeslogic suggestion works for you @piyushmaheswari, thank you @kodeslogic 0 -
Let us know if @kodeslogic suggestion works for you @piyushmaheswari, thank you @kodeslogic
It does; thank you, kodeslogic. Best wishes, Bogdan Ciocoiu www.pmunit.com0
Please sign in to leave a comment.
Comments
3 comments