Archive for the ‘shell’ Category

Shell script to backup all MySQL databases

Posted: 1st April 2010 by Valkyrka in bash, mysql, shell

This is a script which I wrote that backs up all of your databases in /home. If this is a cPanel / Plesk box, it automatically logs in and creates the dump. If this is a non-cPanel / non-Plesk box, the script will ask you for the MySQL root password. The backups are archived using [...]

Shell script to create DNS zone

Posted: 29th March 2010 by Valkyrka in bash, dns, shell

This is a shell script which I recently wrote which creates a DNS zone in /var/named called domain.com.db ( where domain.com is the domain you inputted upon the script execution). Execution of the script is stopped if you are trying to run the script as a non-root user given the needed permissions you would need [...]

Shell script to create MySQL user

Posted: 26th March 2010 by Valkyrka in bash, shell

This is a small shell script which I wrote that will create a MySQL user using a username / password entered. The script automatically logs in as the root / admin username on cPanel / Plesk boxes and only asks for the MySQL root password on non-cPanel / non-Plesk boxes. Here is the script :