Linux _bash _script

Hi All,

Please help with this.

script which I wrote refer picture 1

output which I got
Initially the archive file was there.
image

error message which I got
image

prior to the script execution I have done following steps
Step1 : I have made ssh less authentication from app03 server to backup server by this commands:
1)ssh-keygen -t rsa
2) ssh-copy-id clint@backup server’s IP
and restarted the sshd service
Step 2: I have edited the visudo file with following command
1) banner ALL=(ALL) NOPASSWD: ALL
to avoid typing password for script execution

additional question : Though I did ssh less authentication,it is asking for password when scp command executes in my script .But when ssh from app03 to backup it is not asking for password.

Hello, @dineshkumar14
You have to perform a task from the sudo user of that app server that’s banner but you have added “sudo” in the beginning of the command and treated it as root user.
Hope it helps you to understand the question.
You can request in the “Review” section, if you’re still in a doubt.