Linux Bash script task failed

Hi Team,

I have got the task to create a script to copy the blog file from folder to backer server. I have created it successfully and run it. I could even see the file copied to the server machine using scp command. However my task got failed saying “xfusioncorp_official.zip is not found on backup server”. I had looked into the community group seems like lot of members faced the similar issue. Can you please look into it.

Below are the steps i have followed :

vi /scripts/official_backup.sh
zip /backup/xfusioncorp_official.zip -r /var/www/html/official
scp /backup/xfusioncorp_official.zip clint@server:/backup/

chmod a+x official_backup.sh
ssh-keygen -t rsa
ssh-copy-id -i $HOME/.ssh/id_rsa.pub clint@172.16.238.16
make sure ssh is working without password
run the script and verify in the backup folder & target machine.

@sathish2032

Seems like you tested the whole script from user root on stapp03 and you setup the passwordless from root user itself
zip

You must had tested it from server’s sudo user i.e banner for stapp03.