Backup and Restore MySQL Database Using mysqldump Command

Using mysqldump, you can backup a local database and restore it on a remote database at the same time, using a single command. In this article, let us review several practical examples on how to use mysqldump to backup and restore.

----------------------------------------------------------------------------------------------------------------------------------------

backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql 
 
restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql  

Access files from password proctected site

----------------------------------------------------------------------------------------------------------------------------------------
#wget --user=username --password=password http://example.com/files.tar.gz
----------------------------------------------------------------------------------------------------------------------------------------

Change username and password as your requirement from the above command .

How do I enable server-side includes on my site ?

How do I enable server-side includes on my site ?

    1. #cd /to/your/site/folder

    2. #vi .htaccess

    3. and paste the below content in that 

      ------------------------------------------------------------------------------------------ 
       
      AddType text/html .shtml
      AddHandler server-parsed .shtml
      DirectoryIndex index.shtml index.html index.htm index.php
      Options +IncludesNoExec -ExecCGI 
       
      ------------------------------------------------------------------------------------------ 
    4.  thats it done .

Back up files in linux

The below is the script to backup files in linux :
  • copy the below script and name example.sh
-----------------------------------------------------------------------------------------------------------------------------------------
#!/bin/bash
#START

TIME=`date +"%b-%d-%y_%H-%M-%S"`            
FILENAME="backup-$TIME.tar.gz"     
SRCDIR="/path/to/source/folder"         #please change to your source folder         
DESDIR="/path/to/destination/folder"   # please change to your destination folder        
tar -cpzf $DESDIR/$FILENAME $SRCDIR

find
/path/to/destination/folder/ -iname '*.tar.gz' -ctime +45 -exec rm -f {} \;  #please change to your destination folder
#END

-----------------------------------------------------------------------------------------------------------------------------------------
  •  And change the mode of file example.sh
-----------------------------------------------------------------------------------------------------------------------------------------
 #chmod +x example.sh
-----------------------------------------------------------------------------------------------------------------------------------------
  • And move the examle.sh file  
-----------------------------------------------------------------------------------------------------------------------------------------
#mv example.sh /bin/
-----------------------------------------------------------------------------------------------------------------------------------------
  • Now edit crontab
-----------------------------------------------------------------------------------------------------------------------------------------
 #sudo crontab -e

 45 22 * * * example.sh    #Edit as your requirement
-----------------------------------------------------------------------------------------------------------------------------------------

Start and Stop ssh-agent

Below is the bash script used to start and stop ss-agent #!/bin/bash ## in .bash_profile SSHAGENT=`which ssh-agent` SSHAGENTARGS="...