Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Coding done with Mu Python The system administrators leave the output format up to you. Double Mega, the company that you work for, has three
Coding done with Mu Python
The system administrators leave the output format up to you.
Double Mega, 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: o The MD5 sum o Two spaces o 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, so that they may modify it later. You program 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) Here is a sample section of one of the files: c258d6d2d8867a 64e3165a68a043d510 /bin/plymouth b85108c33acbcb95e155a7d4e8710407 /bin/bzip2recover a 92529508lbleb65f164afeddd1d601a /bintfscmp 416c713df93c8efc0008db09f32c7cld /bin/dd f98f41c8104b8976d7f1201d245f3cc9 /bintfstruncate c165e7c36662e7bead943a852c59c8cl /bin/btrfs-zero-log aea2dd251b84ca50adc30039fde 0635f /bin/chacl 28fa697d5642 a79fdd8e0b17177395fa /bin/logincti ec76a0cfb97b5370ec9fa499a101323d /bin/btrfs-find-root 05e637245b2684c80cla9c76a919d805 /bin/tailf Here is a sample run: >py -3 testi.py Enter filename for first system: pallas. list Enter filename for second system: athena.list Enter prefix to test: /sbin /sbin/brcti is not on system 2 n/upstart-udev-bridge is not on system i sbin/mount.nilfs2 is not on system 1 /sbin/mountall is not on system 1 /sbin/gdisk is not on system 1 /sbin/mkfs.nilfs2 is not on system 1 /sbin/mntctl is not on system 1 /sbin/upsd is not on system 1 /sbin/upstart-event-bridge is not on system 1 /sbin/umount. udisks2 is not on system 1 /sbin/upsdrvcti 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.nilfs2 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 i /sbin/initctl is not on system 1 /sbin/upssched is not on system 1 Double Mega, 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: o The MD5 sum o Two spaces o 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, so that they may modify it later. You program 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) Here is a sample section of one of the files: c258d6d2d8867a 64e3165a68a043d510 /bin/plymouth b85108c33acbcb95e155a7d4e8710407 /bin/bzip2recover a 92529508lbleb65f164afeddd1d601a /bintfscmp 416c713df93c8efc0008db09f32c7cld /bin/dd f98f41c8104b8976d7f1201d245f3cc9 /bintfstruncate c165e7c36662e7bead943a852c59c8cl /bin/btrfs-zero-log aea2dd251b84ca50adc30039fde 0635f /bin/chacl 28fa697d5642 a79fdd8e0b17177395fa /bin/logincti ec76a0cfb97b5370ec9fa499a101323d /bin/btrfs-find-root 05e637245b2684c80cla9c76a919d805 /bin/tailf Here is a sample run: >py -3 testi.py Enter filename for first system: pallas. list Enter filename for second system: athena.list Enter prefix to test: /sbin /sbin/brcti is not on system 2 n/upstart-udev-bridge is not on system i sbin/mount.nilfs2 is not on system 1 /sbin/mountall is not on system 1 /sbin/gdisk is not on system 1 /sbin/mkfs.nilfs2 is not on system 1 /sbin/mntctl is not on system 1 /sbin/upsd is not on system 1 /sbin/upstart-event-bridge is not on system 1 /sbin/umount. udisks2 is not on system 1 /sbin/upsdrvcti 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.nilfs2 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 i /sbin/initctl is not on system 1 /sbin/upssched is not on system 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started