{"id":20537335,"url":"https://github.com/apoorv0503/apoorva-scaler-bash-assignment","last_synced_at":"2026-04-11T06:43:46.411Z","repository":{"id":242504783,"uuid":"809728914","full_name":"Apoorv0503/Apoorva-Scaler-Bash-Assignment","owner":"Apoorv0503","description":"My solution implementation  of devops assignment along with outputs.","archived":false,"fork":false,"pushed_at":"2024-06-03T11:13:47.000Z","size":95,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T03:43:22.730Z","etag":null,"topics":["bash-script","linux","logs-analysis","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Apoorv0503.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-03T10:39:27.000Z","updated_at":"2024-06-03T11:16:31.000Z","dependencies_parsed_at":"2024-06-03T12:56:43.525Z","dependency_job_id":"537af691-919a-495e-beee-8889f653d2a7","html_url":"https://github.com/Apoorv0503/Apoorva-Scaler-Bash-Assignment","commit_stats":null,"previous_names":["apoorv0503/apoorv0503-apoorva-scaler-bash-assignment"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Apoorv0503/Apoorva-Scaler-Bash-Assignment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apoorv0503%2FApoorva-Scaler-Bash-Assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apoorv0503%2FApoorva-Scaler-Bash-Assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apoorv0503%2FApoorva-Scaler-Bash-Assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apoorv0503%2FApoorva-Scaler-Bash-Assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Apoorv0503","download_url":"https://codeload.github.com/Apoorv0503/Apoorva-Scaler-Bash-Assignment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apoorv0503%2FApoorva-Scaler-Bash-Assignment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31671629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","linux","logs-analysis","ubuntu"],"created_at":"2024-11-16T00:39:57.768Z","updated_at":"2026-04-11T06:43:46.377Z","avatar_url":"https://github.com/Apoorv0503.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Devops Assignment\n\nBelow is the questions description and solution for them along with the output generated for those questions.\n\n\n\n## Question 1 - Log File Analysis\n\n#### Objective: \nWrite a Bash script that analyzes a server log file and extracts useful statistics and information, demonstrating your ability to manipulate file data and effectively utilize Bash commands.\n\n#### Requirements:  \n- **Features Implemented:**\n    - Total Requests Count: Output the total number of requests in the log file.\n    - Percentage of Successful Requests: Calculate and print the percentage of successful requests (HTTP status codes in the range 200-299).\n    - Most Active User: Display the IP address of the user who made the most requests.\n\n- **Output Format:**\n    The output should be formatted clearly and readable. Each piece of information should be prefixed with a descriptive label.\n\n## Solution:\n\nPlease refer question1.sh file above\n\n**Basic folder structure:**\n3 scripts, 1 sub-directory and a text file with server logs\n\n![folder_structure](https://github.com/Apoorv0503/Apoorv0503-Apoorva-Scaler-Bash-Assignment/blob/main/Outputs/main_dir.png?raw=true)\n\n**Upon execution of solution script:**\n\n![sol1_output](https://github.com/Apoorv0503/Apoorv0503-Apoorva-Scaler-Bash-Assignment/blob/main/Outputs/sol1.png?raw=true)\n\n\n## Question 2 - Extract and Count File Types\n\n#### Objective: \nWrite a script that counts and lists how many files of each type are present in a given directory.\n\n#### Requirements:  \n- **Features Implemented:**\n    - Traverse a specified directory recursively.\n    - Identify file types based on file extensions.\n    - Count and list the number of files for each file type.\n\n- **Output Format:**\n    Display a sorted list of file types along with their counts.\n\n## Solution:\n\nPlease refer question2.sh file above\n\n**Basic folder structure:**\n1 sub-directory with different kind of files to count.\n\n![folder_structure](https://github.com/Apoorv0503/Apoorv0503-Apoorva-Scaler-Bash-Assignment/blob/main/Outputs/sol2_setup.png?raw=true)\n\n**Upon execution of solution script:**\n\n![sol1_output](https://github.com/Apoorv0503/Apoorv0503-Apoorva-Scaler-Bash-Assignment/blob/main/Outputs/sol2.png?raw=true)\n\n\n## Question 3 - Check Service Status\n\n#### Objective: \nDevelop a script that checks if a specific system service (like Apache or SSH) is running and reports its status.\n\n#### Requirements:  \n- **Features Implemented:**\n    - Accept the service name as a command line argument.\n    - Use system commands to check if the service is active and running.\n    - Output the current status of the service.\n\n- **Output Format:**\n    Clearly state whether the specified service is running or not.\n\n## Solution:\n\nPlease refer question3.sh file above\n\n**system processes used here:**\nI have used the basic system processes like cron, MySQL(Database Server), Network Manager and ssh.\n\n**Upon execution of solution script:**\n\n![sol3_output](https://github.com/Apoorv0503/Apoorv0503-Apoorva-Scaler-Bash-Assignment/blob/main/Outputs/sol3.png?raw=true)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapoorv0503%2Fapoorva-scaler-bash-assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapoorv0503%2Fapoorva-scaler-bash-assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapoorv0503%2Fapoorva-scaler-bash-assignment/lists"}