Linux Bash Scripts Kodekloud




At first login to app server02

ssh [email protected] 

Then go to scripts folder and create


Next write this commands and save it

zip -r /backup/ /var/www/html/media
scp /backup/ [email protected]:/backup/

Then create a keygen and copy the key to backup server so that bash script will not require any password


ssh-copy-id [email protected]

Finally go to scripts folder and run the bash scripts by this command


Now you can check the backup folder for the zip file on both app02 and backup server. If you find the zip file then it should be done.

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment


  1. Hi Shawon,
    where am I supposed to run keygen commands?
    inside the script? or in application server? or backup server?
    also, do I need to run as sudo?