Create a file called terminatesuspended.sh
Add the following code
for i in `find /var/cpanel/suspended/ -mtime +30 | cut -d’/’ -f5 | sed ’1 d’`
y | /scripts/killacct $i;
The suspended accounts username are saved under the /var/cpanel/suspended directory. The find command will search files under the /var/cpanel/suspended/ directory which are 30 days old and will pass the username to the ‘killacct’ command.
Save the file and set a cronjob to execute the file once in a day. Edit the root cronjob file
Add the following cronjob
0 1 * * * /bin/sh /root/terminatesuspended.sh