Following are the steps to take increment backup of reseller account on backup server. 1) First we need to find out the user name which is under the reseller account. On shared/source server :- vi /home/resellerUsername/backup.sh # For finding the...
Category: Shell Programming and Scripting
find out the reseller name with domains
How to find out the reseller name with domains? Ans : If you want to list all cPanel accounts under a specific reseller, then you can use the below simple shell script. 1) Crete the file reseller.sh and add the...
terminate old suspended accounts
Question : How to terminate old suspended accounts on cpanel server ? Ans: You can terminate the 90 days old suspended accounts by using the following script. 1) vi /root/terminatesuspended.sh ================== for i in `find /var/cpanel/suspended/ -mtime +90 | cut...
Script to automatically start nginx
You can use the following script to auto restart the nginx on the server. The following script check the status and if it is down then it restart. You can set cron "* * * * * /bin/sh /root/autongnixrestart.sh" ========================== #!...
Script to automatically start mysql
The following script is used to start mysql automatically when it is failed or stopped on the server. You can set 2 min cron "*/2 * * * * /bin/sh /root/automysqlstart.sh" and it restart the mysql automatically. ============================ #!/bin/bash #Checking whether MySQL...
how to run bash scripts from local machine to remote linux machine
Q. How to run bash script from local machine to remote linux machine ? Ans : We can run the bash script from our local machine to remote machine without login to remote server. We will get the result of...
script to check NFS mount point
How to check NFS mount point by using the script ? Ans : If you we have mounted the NFS directory one or more servers and you want to monitor that mount point then you can use the following method....
Script to restart any service automatically
We can set the cron to restart the server when it was down or not running. You can use following script to detect and restart the httpd,ngnix,Serv-U or any other services. 1) Create the file vi /root/autorestart.sh and add the...
Make your shell colorful
You can easily changed your black ssh screen to colorful screen by using following steps. 1) Login to the server via SSH as root 2) Edit the .bash_profile file found in the /root directory & paste the following line: vi ...
email when access the server
It's always a good practice & from the security point of view to get notified instantly through an email when someone logs into your server through SSH with root privileges. Open the file .bashrc for the root user. Vi /root/.bashrc...