Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in Python please. DoubleMega, the company that you work for, has three Linux servers: pallas, minerva, and athena. You are asked by the system

Code in Python please.

image text in transcribedimage text in transcribedimage text in transcribed

DoubleMega, the company that you work for, has three Linux servers: pallas, minerva, and athena. You are asked by the system administrator to help them identify the differences between the servers. They need a program to compare the files on any two systems. Specifically, and given two systems, they are looking for the following differences: 1. What files are on the first system that are not on the second system? 2. What files are on the second system that are not on the first system? 3. What files are on both systems, but are different? 4. (And optionally), What files are on both systems, but have different filenames? To help you with this, the system administrator is providing you with a list of all files in directories that they are interested in (e.g. they did not include /home). They ran all of the files in those directories through a MD5 check-summing program called md5sum., and created one text file for each system with the following format: - Each line represents one file on the system - Each line is formatted into the following parts: - The MD5 sum - Two spaces The corresponding filename The files may have lines with incorrect Unicode characters, so on the open line, use something similar to: f=open(filename,encoding="utf-8",errors="ignore") For this project, they have requested the program to be written in Python or Java cor another language if approved ahead of time), so that they may modify it later. You progran should ask the user for the following three things: 1. The filename that represents the first system 2. The filename that represents the second system 3. A prefix to focus the search in (e.g. if the user types in /etc/init.d only results that start with that string are shown) The program should handle any filename, so do not limit it to just the three test file cases. Likewise, do not assume any specific directory. Additionally, the filenames given might contain a directory. The output format should use the same format as the example below, but the order of the lines is not important. Do not show lines for files that are identical on both systems. Here is a sample run: \begin{tabular}{l} >py -3 test1.py \\ Enter filename for first system: pallas.list \\ Enter filename for second system: athena.list \\ Enter prefix to test: /sbin \\ /sbin/brctl is not on system 2 \\ /sbin/upstart-udev-bridge is not on system 1 \\ /sbin/mount.nilfs is not on system 1 \\ /sbin/mountall is not on system 1 \\ /sbin/gdisk is not on system 1 \\ /sbin/mkfs.nilfs is not on system 1 \\ /sbin/mntct1 is not on system 1 \\ /sbin/upsdis not on system 1 \\ /sbin/upstart-event-bridge is not on system 1 \\ /sbin/umount.udisks 2 is not on system 1 \\ /sbin/upsdrvctl is not on system 1 \\ /sbin/upsmon is not on system 1 \\ /sbin/upstart-dbus-bridge is not on system 1 \\ /sbin/upstart-socket-bridge is not on system 1 \\ /sbin/prime-switch is not on system 1 \\ /sbinilfs_cleanerd is not on system 1 \\ /sbin/get-quirk-options is not on system 1 \\ /sbin/umount.nilfs is not on system 1 \\ /sbin/wpa_action is not on system 1 \\ /sbin/upstart is not on system 1 \\ /sbin/fixparts is not on system 1 \\ /sbin/wpa_cli is not on system 1 \\ /sbin/create-uvm-dev-node is not on system 1 \\ /sbin/upstart-file-bridge is not on system 1 \\ /sbin/prime-offload is not on system 1 \\ /sbin/upstart-local-bridge is not on system 1 \\ /sbin/sgdisk is not on system 1 \\ /sbin/cgdisk is not on system 1 \\ /sbin/wpa supplicant is not on system 1 \\ /sbin/initcti is not on system 1 \\ /sbin/upssched is not on system 1 \\ \hline \end{tabular}

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions