Unix bash shell scripts

  • Status Closed
  • Budget N/A
  • Total Bids 28

Project Description

Write a shell script will compress (using tar) ALL user directories (in /home) and save the backups in a rotated fashion in a predefined directory.

a. You should use three backup files for rotation and they should be named using numbers in the following format: ..tar.gz. So for the student user account, there should be three files [url removed, login to view], [url removed, login to view], & [url removed, login to view] with 3 being the oldest and 1 being the newest.

b. Your script should back up the directory of interest, preserving permissions and using gzip compression (add the –z) and the new backup should replace 1, 1 should replace 2, 2 should replace 3, and 3 should be deleted.

c. Your script must do this for ALL user directories in /home

Write a script which adds a list of users non-interactively.

a. Your script should read the names of the users (each on a line by themselves) from STDIN

b. Other than the defaults, set the password (to the user’s name), ensure directory creation, and lock the account after creation.

c. Your script should check to see if the user already exists and NOT attempt to add the user if the user exists (hint: `cat /etc/passwd | grep $username` and check to see if empty)

d. STDIN implies it should run like: cat /root/users | ./[url removed, login to view]

Write a shell script which takes a regular file from the command line, performs some basic error checking (file must exist and be readable) and displays the results of ls –l command for the given file, followed by a blank line, followed by the contents of the file line by line with each line number prepended on the same line.

a. Command line implies command will be run like: ./[url removed, login to view] filename

Get free quotes for a project like this
Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online