This is the Simple Shell Script to take the dump of Mysql Database either full or selective. Requirements: O.S:Linux Editor:gedit vim according to our choice. Software:mysql server installed in Linux.
Steps: 1. Write the shell script as Below.
#!/bin/bash
#shell script to take the backup of the mysql database dump
#first shell script will check for the user is root user or not,if not then it exits.
user=`whoami`
if [ $user != ‘root’ ];then
echo ‘user $user is not a root user this insidence will be reported ‘
exit 12
fi
host=’localhost’
mysql_user=’root’
mysql_pass=’root’
date=`date +%y-%m-%d`
#mysql dump used to create the dump of the database
echo “======================list of known databases==========================”
mysql -uroot -proot -e “show databases”
###########################################
#asking for the user which database you want to dump
echo “FULL or SELECTIVE”
echo “Choose your database dump option”
read SEL
case $SEL in
FULL)
echo “Backup of all database”
mysqldump -uroot -proot –all-databases > /var/tmp/1.sql
if [ $? -eq 0 ];then
echo ‘database dump successful’
else
echo ‘database dump failed’
fi
exit 15
;;
SELECTIVE)
echo “Backup of selective database choose database you want to dump?”
read database
mysqldump -h$host -u$mysql_user -p$mysql_pass -B $database>$database.$date.sql
if [ $? -eq 0 ];then
echo ‘database dump successful’
else
echo ‘database dump failed’
fi
exit 15
;;
esce
2.save the shell script by <any name>.sh extension
3.We can run shell script either giving the executable permission to the file or by sh command as below
3.1 root@L595:~/shellscript#chmod 777 mysqldump.sh
root@L595:~/shellscript#./mysqldump.sh
or root@L595:~/shellscript#sh mysqldump.sh
OUTPUT:
==================================================================================================
root@L595:~/shellscript# sh mysqldump.sh
======================list of known databases==========================
+——————–+
| Database |
+——————–+
| information_schema |
| employee |
| misal |
| mysql |
| performance_schema |
+——————–+
FULL or SELECTIVE
Choose your database dump option
FULL
Backup of all database
database dump successful
root@L595:~/shellscript#
*/backup of selective database */
root@L595:~/shellscript# sh mysqldump.sh
======================list of known databases==========================
+——————–+
| Database |
+——————–+
| information_schema |
| employee |
| misal |
| mysql |
| performance_schema |
+——————–+
FULL or SELECTIVE
Choose your database dump option
SELECTIVE
Backup of selective database choose database you want to dump?
employee
database dump successful
root@L595:~/shellscript#ls -l
employee.15-03-22.sql
What is Joomla? Joomla is one of the most Popular Content Management System (CMS) Like WordPress.Which is having different tools available creating the dynamic website, writing the Blogs. Without having prior knowledge of programming Language one can easily create dynamic pages, Blogs,Upload Pictures with Joomla. Why to Install Joomla in Linux?
Linux is popular mostly in the server side and Use of Linux Apache Mysql Php (LAMP) for web hosting over the Cloud(VPS) or in Data Center is increasing now a days. Everything is open source. we can get advantage of different Communities for Troubleshooting the issues.
Perquisites:
Redhat Linux/Centos/Fedora
Linux Apache Mysql Php(LAMP) already installed using Package Manager (YUM).
JOOMLA.
In this tutorial I am going to show you how to install and configure the Joomla in Linux .
STEP 1:
First check all the required packages along with their dependencies are installed or not.If not then install it using YUM. [root@srk html]# yum -y install httpd* mysql* php-*
STEP 2:
Go to the Document Root of Apache (/var/www/html) and Download the Joomla from the https://joomlacode.org by wget command and extract it using tar archive. [root@srk html]# wget http://joomlacode.org/gf/download/frsrelease/18323/80367/Joomla_3.1.1-Stable-Full_Package.tar.gz [root@srk html]# tar -xzpvf Joomla_3.1.1-Stable-Full_Package.tar.gz STEP 3:
Change the ownership and group ownership of the Document root to the Apache user. [root@srk]# chown -R apache:apache /var/www/html STEP 4:
Go to the configuration file of the apache and edit the following lines [root@srk html]# vi /etc/httpd/conf/httpd.conf
ServerAdmin root@admin.com # give your domain name here
ServerName http://www.admin.com:80 # give name for site,if your DNS is configured otherwise keep IP address of your computer.
Restart the httpd service and permanently on the service [root@srk html]#service httpd restart [root@srk html]# chkconfig httpd on STEP 5:
Mysql Configuration
Login As a root user to Mysql,Create database joomla and grant all privileges as follows: mysql> create database joomla; mysql>grant all on joomla.* to joomla@’localhost’ identified by ‘redhat’; mysql> flush privileges; mysql>exit; STEP 6:
Go to the Browser and type your domain name or ip address and press enter this will shows you joomla installation screen. STEP 7:
Database Configuration STEP 8:
Setup Completed. STEP 9:
Admin Panel of joomla.
Telnet protocol is user to connect the remote Computer(also called as Host computer) over the TCP/IP network. Using Telnet client software we can establish a connection with the remote server such as (Linux,Unix,Mac).Once you establish a connection your terminal become an virtual Terminal.
Telnet can works on Port no 23.
We have to enter the command in command Prompt as
telnet hostname/IP address Port No(By default 23),which establish connection with the remote server. Disadvantage using Telnet
The data transferred in between Client and server is in the form of Plane Text.
So there must be a possibility of Intruder (Hacker) can hack the data while data is being transmitted. So Telnet is not secure Protocol.
It can be used in small Offices,Colleges,Labs where there is no primary issue of security.
Most of Big companies strictly prohibit the use of telnet. They use SSH Protocol to connect with the Remote server which is very secure than the Telnet protocol. Implementation of telnet server in RHEL6/FEDORA/CENTOS
For implementing the telnet server in Fedora/Centos/Rhel6 it is necessary to check the following package must be installed on system.
• telnet-server.
• xineted. 1.Check whether the packages are installed on system or not
rpm -qa telnet-server
rpm –qa xinetd
2.If the packages are not installed Install using yum or rpm command. yum –y install telnet* xinetd
3.After installation of packages go to the configuration file of telnet and make change configuration file as follows. vim /etc/xinetd.d/telnet make disabled=no .so Telnet client can connect to the remote server.
4.Restart the xinetd service and also make telnet server can be available at booting time on as follows
service xinted restart
chkconfig telnet on
5.Telnet client can’t directly connected to root account. so add one user and assing password to that user
useradd sandesh
passwd sandesh
Logging to telnet server using the telnet client
1.Telnet client is not enabled on windows by default. for enabling it do following steps:
Start->Control Panel->Programs and Features->Turn Windows Feature on or off
->(check the check box) telnet->click on Ok button.
It will turn the telnet feature on.
2.Go to Run -> type CMD.
3.within Command Prompt type the command as follows
telnet ip ( ip address of remote server)
eg
telnet 192.168.2.129
4.It will ask for login user and password for connecting to the remote server, type User name and Password .
This tutorial is helping you to understand the basic concept in Linux . What is Linux?
Linux is the Operating System which was developed by Linux Torvalds.It is free and open source operating System and it is diff rant from Unix operating system.Most of us we think that it is same as that of Unix.Its structure is similar to Unix.
Linux is mostly used as server side operating system which can be used to built various servers such as Mail server,web server,samba server,DNS server etc. We can use Linux as Desktop O.S such as Ubuntu,Linux Mint which is having very rich Graphical User interface. The software’s run inside the Linux O.S are very diffrant from Windows O.S. Distributions
When the Linux was first discovered, it was Single Operating System.Linus created the original Version of Linux Kernel and it’ source code was distributed to the people. So people from diff rant regions created the diffrant versions of Linux by modifying the source code.Today their are many distributions can be available such as Red Hat linux,Suse Linux,Ubantu,Linux Mint etc. Every Linux Distribution is made for specific purpose. So before installing the Linux,we have to think about that what type of services we actually want,example whether we want to use linux as a server or desktop. and according to that we have to go to specific Distribution
Root
Root is the Superuser in Linux.Root having full access over the system. The normal user having the limited privilege to access the system.The root user can do multiple tasks such user administration,server installation,Back up and Recovery,Monitoring the Log files etc.It can be represented in terminal as # and the normal user can be represented by $ in terminal.
Shell
The computer can understand the language of 0’s and 1’s Known as the binary language. In early days of computing the instruction were providing using binary language which is difficult for all of us to read and write all those files in those directory .so in Linux there is special program called Shell. Shell accepts instruction from command line interface and and if it is valid command it passes to the kernel. The shell acts as an Interpreter which reads the command from input devices such as Keyboard and passes them into the Kernel.
Capitalization
The capitalization is one of the most important thing in Linux world .In widows world capitalization does not matter.
eg. If we create the folder under Windows and named as Data and search for the folder by naming the DATA|Data|data. It will give same result named as Data because all the folder name pointing towards the Data. But in linux these folders or file names are different. These pointing towards three different folder. So the Data folder is different from DATA folder.
Server Vs Desktop
Linux comes under two diff rant versions. Server version and Desktop Version. The Server version contain only the command line interface (CLI).If we can install server version, then we will get only the Login shell with blinking cursor onto which we have to fire the commands.
If we can install Desktop version then we will get the nice fancy looking Graphical User Interface(GUI) just like as windows. In Linux Desktop we can also install software just like windows like Games, Media players, Image editing software.
For beginner user it is better to install the Desktop version of Linux and play with Linux Such as Ubantu Linux, Linux Mint, Puppy Linux etc.