Find the answer to your Linux question:
Results 1 to 2 of 2
Hi can somebody please help me with this exercise. i was gone from school for a few weeks and i just came back, my teacher just gave it to me ...
  1. #1
    Just Joined!
    Join Date
    Feb 2009
    Posts
    1

    batch script need help

    Hi can somebody please help me with this exercise. i was gone from school for a few weeks and i just came back, my teacher just gave it to me and told me it has to be done by tomorrow.
    and i am like totaly lost it has to be batch script with functions.......
    the exercise is not for marks, but its for bonus marks, and i really need the marks.

    Linux Script Eexercise
    Write a script called bkup that:
    1) Accepts a list of one or more source files and a destination directory as arguments. Your
    script must display an error message if arguments are invalid, and then terminate.

    2) Clear the screen before you begin processing the command.

    3) If the destination directory exists, prompt the user to verify that this is destination is
    acceptable. For example:
    ▪ if user responds y then continue processing
    ▪ if user responds n then terminate the script.
    ▪ else, prompt again.

    4) If the destination directory does not exist, prompt the user to verify that they want to create it.
    ▪ if user responds y then attempt to create the directory
    verify that the directory was created before proceeding.

    if successful, continue processing

    else display an error and terminate the script:

    ▪ if user responds n then terminate the script.
    ▪ if user does not answer y or n, prompt again

    5) Copies specified files from source to destination. Do not process directories.

    6) Creates a file called BKUP_REPORT in the destination directory summarizing actions taken
    during processing.
    a) Output the contents of BKUP_REPORT to the screen.
    b) Count the number of files processed.
    c) Provide the total size of files that have been processed
    d) Count the number of files that were not processed
    e) Count the number of directories that were not processed.
    Format report as shown below:

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...