the questions were in that form
a- create a zip archive named xfusioncorp_news.zip of /var/www/html/news
b- save that file in /backup/ on app server 3
c- copy the created file to Backup server in /backup/
d- make sure that script won’t ask for password while copying the file.
for the Q-a and Q-b i set up zip unzip package, nothing mentioned about tar command, so i add the cmd below to my script:
zip -r /backup/xfusioncorp_news.zip /var/www/html/news
that command permit to create and save the zip file in /backup
for the Q-c Q-d, i run the cmds bellow:
1- ssh-keygen
2- ssh-cpy-id clint@st…
3- then i add that cmd line to my script scp -r /backup/xfusioncorp_news.zip clint@stbkp01:/backup/
the script executed with success, finnaly i checked out the output files which are located on there original path /back in stapp03 and /back in stbkp01.
hello
your line q-a should also be in your script you had to create zip file through script not separately
bot of your lines Q-a & Q-3 should have been in script
yes, i already dit that, after reviewing, i think that i needed to copy keyid to stbkp01 from banner user not from root, therefore avoiding script asks for password while copying backup to stbkp
using theses two commands will allow to you, to create your own script under /scripts/name-of-your-script.sh
any script should begin by #!/bin/bash and remenber thats cmds will run from the top first sd 3th …etc
furthermore, to make the script run without asking for password of clint user user in the second cmd, we need to generate a key and copy that key on stbkp server so try to follow these cmds :
ssh-keygen
ssh-copy-id clint@stbkp01
So in that step you will almost finish you must just run you script and check the destination dir that it contains backup files
Though the zip files are getting copied to application server and backup server.
however, I am prompted for user password. so somewhere I am going wrong.
Hello, @yogendra
I think you have to perform this task from respective sudo user of the app server. You are in the app server 1 so should be tony not root.