Question: Could you please answer the following script in python. Thank you 1. Implement a function to backup files in a given directory. Your function should

Could you please answer the following script in python. Thank you

1. 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 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 10 PTS

2.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. Valid archive types are zip,gztar,tar,bztar and xztar. Ensure that a valid archive type is provided by the user .10 PTS

3.As a system administrator, you realize that some archived files contain 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 10PTS

4.Implement a function that displays all files in a given directory that were modified in the last 2weeks.The function should accept as argument ,the directory of interest. If no directory is specified or the directory specified does not exits, the current working directory should be used.10PTS

5.Write a script that allows a user to utilize the functions implemented in 1, 2, 3 & 4 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.5 PTS

6.Comment your code appropriately

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!