Linux Bash Scripts Task Marked Failed xfusioncorp_official.zip not found under /backup

Hi all,

Could someone please check why my task was marked as failed when clearly I have followed the instructions as per printed in the task GUI:

The task says to:

  • a. Create a zip archive named xfusioncorp_official.zip of /var/www/html/official directory.

  • b. Save the archive in /backup/ on App Server 1

  • c. Copy the created archive to Nautilus Backup Server server in /backup/ location.

…but the task prompt says that:

  • xfusioncorp_official.zip not found under /backup on Backup server!!!

I am noticing a lack of a / at the end of the ‘error’ (as opposed to /backup/ that is noted/listed in the instructions)

.
If this is what caused it, it (the testing/validation) is either incorrect or the instructions are misleading &/or incorrect…or at least that is how it appears on the surface:-)

I believe that I have been incorrectly marked as a fail on this one…super frustrating, especially being that you only get one chance to validate your answer.

Could someone please look into this for me?

Thanks:-)

PS. Here are some additional screenshots:

Hello, juliettet
You can visit this post.

Hi @player001,

Thank you for responding and thank you for the link. :smiley: However, I believe that my situation is a bit
different then as discussed via the link.

I was able to copy the script over without having to enter a password. The script did not ask for password while copying the archive file because the first thing that I did (after SSHing over to App Server 1) was run:

 ssh-keygen
 ls -al ~/.ssh/
 ssh-copy-id -i ~/.ssh/id_rsa.pub clint@172.16.238.16

Here are the steps that I took (in the order entered):

ssh tony@stapp01  //enter Tony's password
# from App Server 1
ssh-keygen
ls -al ~/.ssh/
ssh-copy-id -i ~/.ssh/id_rsa.pub clint@172.16.238.16
# From Backup server
ssh clint@172.16.238.16 //enter Clint's password
# check to see that key was successfully transferred over
cat /home/clint/.ssh/authorized_keys
# Back on App Server 1
# Login from App Server 1 to Backup Server without Password/check to see
# if login without password successful
ssh clint@172.16.238.16 //no prompt for password
exit
# back on App Server 1
sudo yum install zip

create script:

cd /scripts
sudo vi official_backup.sh
# add:
sudo zip -r xfusioncorp_official.zip /var/www/html/official
mv xfusioncorp_official.zip /backup/
cd /backup/
sudo scp xfusioncorp_official.zip clint@stbkp01:/backup/    //no password prompt, task successful

The only similarity to the link provided above is that I had sudo prepended to a couple of my commands in the script. The error prompt, however, makes no mention of this being an issue when my task was marked as failed.

make script executable

sudo chmod u+x official_backup.sh
sudo chmod 744 official_backup.sh
# run script
sudo ./official_backup.sh

File was successfully copied over without having to enter a password.

Therefore, I simply cannot see how my task was marked as being incorrect…again, because even with the use of the word sudo, there is no mention of that being an issue in the error/fail output. It instead tells me that my file has not been saved to /backup/.

PS.

I have just gone over the link that you provided a second time…
The thing is that even though I had sudo prepended to a couple of the commands in
the script, the script was still copied over successfully without having to enter in a password.
The error prompt is incorrect in stating that I have not successfully copied over the script
to the /backup/ directory.

Thanks again for your time.

PSS ( :smiley:):
In this link https://community.kodekloud.com/t/linux-bash-scripts-task-failed/10756 it is mentioned that you have to perform this task from their respective sudo user not from root user. In my case, I did perform the task from the respective sudu user (tony@stapp01 in my case), so I know that this is not the reason
for my task being marked as incorrect.

Hi @juliettet. I was just assigned this task and this is the output of what I did. The task was marked successful

scripts file contents:
#!/bin/bash
zip -r /backup/xfusioncorp_beta.zip /var/www/html/beta
scp /backup/xfusioncorp_beta.zip clint@stbkp01:/backup/

Hope this helps

1 Like

Thank you @satagrawal. I would still like to get some input from @Inderpreet, @mmumshad on this matter. There have been other people who have failed this task (listed in other threads in this forum) with the commands typed into the script exactly as you have, so I’m still in need of an
answer (along with some sort for clarification) as to why I received a fail on this task, even though I managed to successfully copy over the script (as user Tony & not as root) to the backup server (per the instructions) without having to login in to the backup server via a password when running the script. I accomplished what the instructions said to do.

At the very least, I feel like I should get a status pending on this one (as other students have in the past) given the ambiguity of the task and the incorrect error output.

Thanks again:-)

@juliettet, completely understand where you coming from. I am sure @Inderpreet and @mmumshad will sort it out. Good Luck!

1 Like

Thank you @satagrawal for understanding and for taking the time to respond:-)

Hi @KodeKloud,

It’s been a week & I still haven’t gotten a response from an admin on this. Can I get a clarification (from an admin) on why my task was marked as failed even though I was able to complete all of the tasks mentioned?

Thank you:-)