Question: Please code in Python: a. Implement a function to backup files in a given directory. Your function should accept as inputs, a folder to be

Please code in Python:

a. Implement a function to backup files in a given directory. Your function should accept as inputs, a folder to be backed up and the destination folder in which files would be backed up to. Handle situation where the source and destination folders are do not exist. For testing purposes, create two directories in your project directory. In one of the directories(your source directory) use the touch Linux command to create four arbitrary files b. Implement a function that accepts a directory as argument and creates an archive out of the contents of the directory. Your function should prompt the user to enter the type of archive to be created. Use exception handling to handle situations where the directory to be backed up and archive type to do not exist. Valid archive types are zip,gztar,tar,bztar and xztar. Ensure that a valid archive type is provided by the user. c. As a system administrator, you realize that some archived files contains files that are very large. Write a function that takes a given zip file as argument and displays the OS and file size ( Kilobytes) of all files with sizes greater than a given threshold(in KB). Your function should be flexible enough to allow the user to indicate the threshold. For testing purposes, please use the attached zip file. Hint: Please remember the OS reports size of files in bytes and a Kilobyte is 1024bytes d. Write a script that allows a user to utilize the functions implemented in 1, 2 & 3 above. Your script should have a text-based menu system (implemented as a function) for the user to select the functionality required. You menu system should ensure that a valid option is selected. e. Comment your code appropriately NB: For c, you would have to explore the zipfile python module to figure out functions that can be used to determine meta-data(size,os etc) of files

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!