Table of Contents

Corning Community College

CSCS1730 UNIX/Linux Fundamentals

Project: Data Archiving and Compression (dac0)

Objective

Reference technical documentation to locate and operate particular tools to aid you in accomplishing a task. Collaboratively construct an informative document to detail how one can prepare to start upon this process.

Prerequisites

To successfully accomplish/perform this project, the listed resources/experiences need to be consulted/achieved:

grabit

As part of this activity is to test your ability to navigate around the filesystem and manipulate files on your own, there is no grabit configured for this project.

EDIT

You will want to go here to edit and fill in the various sections of the document:

DAC0 project documentation

Toolbox

It would be especially useful to review the manual pages or any documentation on the following resources:

  • ls(1) - description of what the command does

Background

What is an archive

An archive is a single file that contains many file making it much easier for to move a bunch of files instead of moving them one at a time. It will effectively keep copies of your files in one place. They can also be compressed to reduce the overall size. In short they are very useful. -c will create well -f specifies the name of the archive file.

What actions can be performed on an archive?

There are many different actions that can be performed on an archive such as compression, extraction, modifications, exploration of files, and password protection. An archive simply collects files together for organization and portability. There are also many different kinds of archive files, one of the most commonly known being .zip.

What is compression

Compression is a method of reducing the size of files by encoding information in ways that reduce redundancy or unimportant information. Compression is especially useful for transferring files over networks, but can also help to reduce disk usage. There are two types of compression: lossy and lossless.

How does compression differ from archiving?

Archiving is mainly used for organization rather than file size reduction. For example, a lot of Minecraft mods archive their constructs and data in JAR files, a specific kind of archive used in Java. This also makes groups of files more easily portable. such as with zip and tar files.

Types of compression (lossy vs lossless)

Lossless compression reduces file size by eliminating statistical redundancies and no information is actually lost with this method of compression. Contrastingly, lossy compression reduces file size by removing information classed as unimportant or unnecessary.

Procedure

Repository Operations

Checking current repository status
Adding untracked files to repository

After creating a file that you want to be tracked, you will run the command: 'hg add'

Committing changes

After adding any untracked files you will run the command 'hg commit -m “sample text” ' which will save any changes made

Pushing commits upstream to server

After running 'hg commit -m' you will need to push the changes by executing 'hg push'

Pulling changes from server

After executing 'hg push' you will then use the command 'hg pull' which will pull the files

Updating current repository

After 'hg pull' it will prompt you to then update the repo by using the command 'hg update'

 

On your development system

On your development system, I want you to do the following:

  1. Figure out the format of the files, and read up on the available tools for manipulating them
  2. Install any needed tools to accomplish the task of accessing the information contained within
  3. Extract the contents of the archive and study it (contents will extract to the current working directory, so you WILL want to be in a custom project directory)
  4. Analyze the files extracted from the archive. Each file will ultimately be contextually readable plain text (in English), but some may be encoded or compressed or otherwise manipulated and will need further processing to get to the final readable state.
    • Once in their readable states, name the files a, b, c, d, e, f, g, h, in order of their file sizes (in bytes), from least to greatest.
  5. Place these single-lettered files in a new tar archive called result.tar (files should be added to the archive in the current directory, do not embed any directory information in the archive).
  6. Compress it (using maximum compression) with gzip(1); it should now be called result.tar.gz
    • you are going to submit this archive
  7. In addition to the created archive, you will also submit a text file named dac0.steps which will contain step-by-step command-lines used to copy, extract, manipulate, rename, create a new archive and compress result.tar.gz (document from the point of having the copied files in place on your development system).
    • you do NOT need to include and repository, verify, or submit commands, JUST those steps for accomplishing the core task of the files in the project to stated specifications.
    • The file should JUST contain the exact commands you used, in order from start to finish. If you'd like to add any additional commentary, prefix it with a # sign.
      • Commands should be left justified, one command-line per line (lines can wrap).

* Do NOT number your steps. Just place the command-line incantations utilized, one after the other.

Verification

One of the tests I will perform for output compliance of your code will involve comparing your program's output against a range of input values, to see if they all output in conformance with project specifications.

I will make use of a checksum to verify exactness.

You will need to run this from your dac0 project directory, where your individual a-h files are located.

You can check your project by typing in the following at the prompt (on lab46):

lab46:~/src/SEMESTER/unix/dac0$ filechk unix dac0

If all aligns, you will see this:

==========unix/dac0 whole file comparison=========================================
 For the file: a
     you want: cca000c9cb8a5c134bed61154a7907ba
     you have: cca000c9cb8a5c134bed61154a7907ba MATCH

 For the file: b
     you want: c8136ca761229bad59497021a8f425af
     you have: c8136ca761229bad59497021a8f425af MATCH

 For the file: c
     you want: d6db0da4b084fff4b255ae7a4e95ed62
     you have: d6db0da4b084fff4b255ae7a4e95ed62 MATCH

 For the file: d
     you want: dadd5272203fa77b80f26cf355e6e833
     you have: dadd5272203fa77b80f26cf355e6e833 MATCH

 For the file: e
     you want: af095aeaaf55a8a3b351a921baebc9e7
     you have: af095aeaaf55a8a3b351a921baebc9e7 MATCH

 For the file: f
     you want: 84d0fd81532fac6c743c8054f76f0270
     you have: 84d0fd81532fac6c743c8054f76f0270 MATCH

 For the file: g
     you want: c36a56a9ab8190e4d007bd16e377639a
     you have: c36a56a9ab8190e4d007bd16e377639a MATCH

 For the file: h
     you want: 226c53b09f112cf7323cd5263302ea95
     you have: 226c53b09f112cf7323cd5263302ea95 MATCH

If something is off, your checksum will not match the dac0 checksum, and verification will instead say “MISMATCH”, like follows (note that a mismatched checksum can be anything, and likely not what is seen in this example):

==========unix/dac0 whole file comparison=========================================
 For the file: a
     you want: cca000c9cb8a5c134bed61154a7907ba
     you have: cca000c9cb8a5c134bed61154a7907ba MATCH

 For the file: b
     you want: d8136ca761229bad59497021a8f425af
     you have: c8136ca761229bad59497021a8f425af MISMATCH

 For the file: c
     you want: d6db0da4b084fff4b255ae7a4e95ed62
     you have: d6db0da4b084fff4b255ae7a4e95ed62 MATCH

 For the file: d
     you want: dadd5272203fa77b80f26cf355e6e833
     you have: dadd5272203fa77b80f26cf355e6e833 MATCH

 For the file: e
     you want: af095aeaaf55a8a3b351a921baebc9e7
     you have: af095aeaaf55a8a3b351a921baebc9e7 MATCH

 For the file: f
     you want: 84d0fd81532fac6c743c8054f76f0270
     you have: 84d0fd81532fac6c743c8054f76f0270 MATCH

 For the file: g
     you want: d36a56a9ab8190e4d007bd16e377639a
     you have: c36a56a9ab8190e4d007bd16e377639a MISMATCH

 For the file: h
     you want: 226c53b09f112cf7323cd5263302ea95
     you have: 226c53b09f112cf7323cd5263302ea95 MATCH

SUBMISSION

To be successful in this project, the following criteria (or their equivalent) must be met:

Submit Tool Usage

Let's say you have completed work on the project, and are ready to submit, you would do the following:

lab46:~/src/SEMESTER/DESIG/PROJECT$ submit DESIG PROJECT file1 file2 file3 ... fileN

A less abstract instantiation of the above (to help you transition):

lab46:~/src/SEMESTER/unix/dac0$ submit unix dac0 result.tar.gz dac0.steps
Submitting unix project "dac0":
    -> result.tar.gz(OK)
    -> dac0.steps(OK)

SUCCESSFULLY SUBMITTED

You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.

RUBRIC

I'll be evaluating the project based on the following criteria:

39:dac0:final tally of results (39/39)
*:dac0:archive submitted [3/3]
*:dac0:archive has correct name of result.tar.gz [3/3]
*:dac0:archive is max compressed with gzip [3/3]
*:dac0:archive is a tar archive [3/3]
*:dac0:archive extracts into current directory [3/3]
*:dac0:archive contains 8 english readable files [3/3]
*:dac0:archived files are named a-h [3/3]
*:dac0:archived files named in order of size [3/3]
*:dac0:instructions submitted in text file [3/3]
*:dac0:instructions in file named dac0.steps [3/3]
*:dac0:dac0.steps contains list of instructions for accomplishing task [3/3]
*:dac0:dac0.steps instructions are accurate and correct [3/3]
*:dac0:dac0.steps any extra information after hash mark [3/3]

Pertaining to the collaborative authoring of project documentation

Additionally