1. Use the tar_archiver.py (from below) as a command to make a tar archive of /tmp...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Use the tar_archiver.py (from below) as a command to make a tar archive of /tmp called mytmp.tar. You'll notice that even after hitting enter to run the command, you still needed to give more data to your script (to tell it which directory you wanted to archive, what to call it, and what compression to use). Requiring this much interaction from the user means that this script is not very good for automation. We can't schedule this script to automatically run, because we (or another admin) need to be present to type @nswers to the prompts. Here is the tar_archiver.py: #!/usr/bin/env python3 import os # Ask user for the directory to archive directory = input ("Enter the directory to archive: ") # Ask user to enter the name for the archive archive_name = input ("Enter the name for the archive: ") # Ask user if they want to compress the archive compress = input ("Would you like to compress the archive? (y/n): ") # If user wants archive to compress let them choose options if compress == "y": while True: compress = input("Enter the type of compression (gzip/bzip2/xzip): ") if compress in ["gzip", "bzip2", "xzip"]: break else: print("Choosee from gzip/bzip2/xzip only.") # a tar command to archive the directory tar_command = f"tar -cvf (archive_name}.tar (directory}" 1. Use the tar_archiver.py (from below) as a command to make a tar archive of /tmp called mytmp.tar. You'll notice that even after hitting enter to run the command, you still needed to give more data to your script (to tell it which directory you wanted to archive, what to call it, and what compression to use). Requiring this much interaction from the user means that this script is not very good for automation. We can't schedule this script to automatically run, because we (or another admin) need to be present to type @nswers to the prompts. Here is the tar_archiver.py: #!/usr/bin/env python3 import os # Ask user for the directory to archive directory = input ("Enter the directory to archive: ") # Ask user to enter the name for the archive archive_name = input ("Enter the name for the archive: ") # Ask user if they want to compress the archive compress = input ("Would you like to compress the archive? (y/n): ") # If user wants archive to compress let them choose options if compress == "y": while True: compress = input("Enter the type of compression (gzip/bzip2/xzip): ") if compress in ["gzip", "bzip2", "xzip"]: break else: print("Choosee from gzip/bzip2/xzip only.") # a tar command to archive the directory tar_command = f"tar -cvf (archive_name}.tar (directory}"
Expert Answer:
Answer rating: 100% (QA)
1 Open a terminal window 2 Navigate to the directory where the tararchiverpy script is located 3 Run the following command 4 When prompted enter the directory to archive eg tmp 5 When prompted enter t... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
ABC had the following income statement for the period ending on December 31, 2020. Income Statement for the year ended 31/12/2020 Net Sales 120,000 Cost of Goods Sold 80,000 Gross Profit 40,000...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
It was 5:30 Friday afternoon, January 22, 2016. Bill Hall, the chairman and CEO of National Brands Inc. was clearing up the last of the papers on his desk and was looking forward to a relaxing...
-
Water is pumped in through the bottom of the tank in Exercise 19. How much work is done to fill the tank (a) To a depth of 2 feet? (b) From a depth of 4 feet to a depth of 6 feet? Data from in...
-
Shown is the machine element of Problem 9.143. Determine its moment of inertia with respect to the line joining the origin O and point A. -1in in
-
A vacuum-propelled capsule for a high-speed tube transportation system of the future is being designed for operation between two stations A and B, which are 10 km apart. If the acceleration and...
-
We first study 3-PBA, a commonly used insecticide found in grains, fruits, and vegetables. How much higher are 3-PBA concentrations while not eating organic versus eating organic? A bootstrap...
-
MSIs educational products are currently sold without any supplemental materials. The company is considering the inclusion of instructional materials such as an overhead slide presentation, potential...
-
Consider the following triangular system: where b is a real number. (x+y+z+w = 2 -6x+5w 3z-w 2w = b2 "I -4
-
Given the following demand functions, express TR as a function of Q and hence sketch the graphs of TR against Q: (a) P = 4 (b) P = 7/Q (c) P = 10 4Q
-
An unusual die has the numbers 2, 2, 3, 3, 7, and 7 on its six faces. Two of these dice are rolled, and the two numbers on the top faces are added. How many different sums are possible? The number of...
-
Theory Y management uses the empowerment of workers and gives them the power to report "bad workers" to management so that these bad workers will be reprimanded.
-
2 5 . 0 L of an ideal gas at 2 7 8 K and 4 . 1 1 atm are heated to 3 9 3 K with a new pressure of 6 . 3 5 atm. What is the new volume ( in L ) ?
-
Explain what happens to a hexane solution of decan thiol - capped gold nanocrystals when it is carefully syringed onto the water's surface. How do you think the optical properties of the gold...
-
The following accounts are in Whispering Winds Limiteds December 3 1 , 2 0 2 3 trial balance: Prepaid Rent $ 1 , 5 0 0 ; FV - OCI Investments $ 6 9 , 0 0 0 ; Unearned Revenue $ 8 , 1 0 0 ; Land Held...
-
The simple interest on an investment is directly proportional to the amount of the investment. By investing $ 4 2 5 0 in a certain bond issue, you obtained payment of $ 2 3 3 . 7 5 after 1 year. Find...
-
The use of quantitative capnography in intubated pt's does what?
-
Information graphics, also called infographics, are wildly popular, especially in online environments. Why do you think infographics continue to receive so much attention? How could infographics be...
-
Leslie is a single taxpayer who is under age 65 and in good health. For 2012, she has a salary of $23,000 and itemized deductions of $1,000. Leslie is entitled to one exemption on her tax return. a....
-
How much of each of the following prizes or awards is taxable? a. Cheline received a $50,000 gift bag at the Oscars in 2012. b. Jon received a gold watch worth $350 for 25 years of service to his...
-
Carl and Jenny adopt a Russian orphan. The adoption takes 2 years and two trips to Russia and is final in 2012. They pay $6,000 in 2011 and $7,500 in 2012 of qualified adoption expenses, and have AGI...
-
The trial balance for Oslo Co. on 31 July 20X7 is given below. The following additional information is relevant. 1. Closing inventory is valued at 180,000. 2. An allowance for doubtful debts is to be...
-
What are the values of the feathering parameters for the airfoils given by Examples 8.5 and 8.6? Examples 8.5 Assume an airfoil pitching about its leading edge and plunging with \(k=0.35\) as follows...
-
Obtain the lift and propulsive force coefficients of an airfoil given in Example 8.6, and compare the results with Problem 8.30. Assume the profile pitches about midchord. Example 8.6 The NACA 0012...
Study smarter with the SolutionInn App