Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a basic script that will check my s3 bucket and print the number of logs in the bucket or return the error messages

I need a basic script that will check my s3 bucket and print the number of logs in the bucket or return the error messages below

Linux/RHEL 7

write the zkills3ctl.sh script to print the logs stored in S3, The normal output format and error output format must look exactly like the examples in the man page.

NAME zkills3ctl -- control zkill log archives. SYNOPSIS zkills3ctl [number]

DESCRIPTION The zkill archive tool lists the logs in the S3 bucket specified by . Optionally, it will delete the oldest logs from S3.

OPTIONS [number] The number of oldest logs to delete.

ERRORS Return codes: -1 The bucket name does not exist. -2 There are fewer logs in the bucket than [number]. -3 Cannot connect to S3

EXAMPLE

$ zkills3ctl UML

zkill-2018-03-04-1520200486.gz

zkill-2018-03-04-1520201201.gz

$ zkills3ctl UML 1

Deleted zkill-2018-03-04-1520200486.gz

$ zkills3ctl UML

zkill-2018-03-04-1520201201.gz

$ zkills3ctl FOO

Error -1 no such bucket exists

$ zkills3ctl UML 2

Error -2 there is only 1 log in the bucket UML

$ mv ~/.aws/credentials /tmp

$ zkills3ctl UML

Error -3 cannot connect to S3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Big Data Interview 751 Comprehensive Questions And Expert Answers

Authors: Mr Bhanu Pratap Mahato

1st Edition

B0CLNT3NVD, 979-8865047216

Students also viewed these Databases questions

Question

2. What are the different types of networks?

Answered: 1 week ago