Zip file contents failed

The requirement was to create a script to do a backup of a particular folder as a zip file and transfer it to the backup server without password prompting. At the end, my script quietly did this and I found the file on the backup server in the correct folder. The system said that I failed because the zip file does contain the correct contents. Should the question be updated or is the checking incomplete? Here is my script on app server 1

backup script

@trwilliams1209 tar command is used to create a tar archive, although you used the extension .zip but it still remains a tar archive. In question it was asked to create a zip archive, i think that is the reason this task failed for you.

Thank you for the response. The ‘z’ in the ‘tar -czf’ command compresses the tarball in zip format with gzip. I could also have used cpio and passed that to any of the compression utilities (bzip2, xz, gzip), but I find that most Linux users use tar, so that is what I went with. I think that the question may need to be revised to be clear what the expected output should be. Alternatively, the validation of the zip file needs to also cater for ‘tar -tzf’ to check if the correct contents are there.

@trwilliams1209

I agree all these utilities are used for compression but that doesn’t mean they are all exactly same. Every utility has their own features/properties. Since in the question it was specifically asked to create a .zip archive so I don’t see any confusion with it. As I say always stick to instructions given in the question :slight_smile: