Linux Bash Scripts - wrong verification

Hello !
I have again issue with task validation for Linux Bash Scripts.

Task Status - Failed

archive does not contain correct data on Backup Server

I verified archive on backup server and it has correct content. Please double check validation script.

Hi @andrzej

In this question it is asked to create a zip archive, The command you used (tar cvzf) to create .zip archive file is incorrect, although the extension you used for archive is .zip but its still a tar archive with gzip compression. As per question you should have created zip archive, I hope it clears why your answer was marked as failed.

I think task is worded wrongly as tar is as well archive. Zipped archive is just zipped tar. In the instructions should be stated exactly which program should be used or which one should not. I insist to re-phrase the question and either mark it as successful or allow me to repeat it.

Hi @andrzej

Thanks for your feedback, we will look into it to see if it can be improved.

Just some explanation, tar utility just bundles files together to make an archive but it does not apply any compression by default that is why we use gzip like utilities along with tar. However zip applies compression by default.
Since question clearly states that we need a zip archive so I didn’t find it confusing between tar or zip.

Thanks for checking and explanation. I hope for others now will be clear how to fulfill this task😉

Hi,
do we need to use sshpass - p “password” to copy files to backup server through the bash script without asking for password?

hi
use below link to easily make your server passwardless i did the same in this task and have pass it
successfully.
https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/
https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/

1 Like

hi @Inderpreet,
I completed the task as instructed and still got failed. Pls check


Screenshot from 2020-03-26 03-58-41

@Sam,

Which command did you used to compress in your scripts? was it tar or gzip or zip ?

I used zip, not sure why it didn’t pass

@Sam

This is where issue is

sc

Since you ran this command using sudo so it tried to copy archive to destination through root user but you setup the passwordless connection between two server through their respective sudo users (which is correct as per question) so archive was never copied during testing.

You saw that archive on destination server because you ran this command within the script without sudo first time which copied the archive but in your final answer you used sudo which caused it to fail.

Now I understand. Thanks

1 Like