CT320: Network and System Administration

Fall 2019

HW 5

CT320 HW5: File Tracker

Motivation

Files appear and disappear. It’s all so hard to follow. If only there were a program to help you keep track of things!                 

Summary

For this assignment, you will write a program called “track”, which helps you keep track of things. It can be a bash script, a perl script, or a python3 script, but nothing else. This program is useful for system monitoring. It will tell you about any files underneath your home directory that have appeared or vanished since the last time this program executed.                 

Output

Normal track output goes to standard output. Only write to standard error for errors.                 

track would typically be executed from cron, where the output gets mailed to you. Of course, track itself knows nothing about email—track simply produces output or not. cron handles emailing the output to you.                 

Sample Runs

Here are some sample runs ($ is my prompt):                 

$ cd
$ ./track
$ touch ~/tmp/alpha
$ date >~/tmp/beta
$ sleep 60
$ cd src
$ echo "Hello" >>gamma
$ ~/track
New:
    -rw------- 1 ct320 class  6 Oct 16 15:13 src/gamma
    -rw------- 1 ct320 class  0 Oct 16 15:12 tmp/alpha
    -rw------- 1 ct320 class 29 Oct 16 15:12 tmp/beta
$ rm ~/tmp/beta
$ cp /etc/group ~/vote-for-jack-in-the-year-65535
$ ~/track
Deleted:
    tmp/beta
New:
    -rw------- 1 ct320 class 1021 Oct 16 15:13 vote-for-jack-in-the-year-65535
$ rm ~/tmp/alpha ~/vote-for-jack-in-the-year-65535
$ ~/track
Deleted:
    tmp/alpha
    vote-for-jack-in-the-year-65535
$ ~/track
$

~/.track-info

Debugging

If you encounter “STACK FRAME LINK OVERFLOW”, then try this:

    export STACK_FRAME_LINK_OVERRIDE=ffff-ad921d60486366258809553a3db49a4a

Hints

Requirements

Submission

Use web checkin, or:                 

    ~ct320/bin/checkin HW5 track

How to receive negative points:                 

Turn in someone else’s work.