Skip to content

Commit 7957044

Browse files
author
chude onyeibo
committed
assignment for chude
1 parent 5204050 commit 7957044

1 file changed

Lines changed: 15 additions & 28 deletions

File tree

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -x
23

34
############################################
@@ -29,40 +30,26 @@ unzip -q rawdata.zip
2930

3031
# 1. Create a directory named data
3132
mkdir data
32-
3333
# 2. Move the ./rawdata directory to ./data/raw
34-
35-
36-
mv rawdata/* data/raw/
37-
38-
34+
mv rawdata data/raw
3935
# 3. List the contents of the ./data/raw directory
4036
ls data/raw
41-
4237
# 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs
43-
44-
mkdir -p data/processed/{server_logs,user_logs,event_logs}
45-
38+
cd data
39+
mkdir -p processed/server_logs processed/user_logs processed/event_logs
4640
# 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs
47-
48-
cp data/raw/*server*.log data/processed/server_logs/
49-
41+
cp raw/*server*.log processed/server_logs/
5042
# 6. Repeat the above step for user logs and event logs
51-
52-
53-
cp data/raw/*event*.log data/processed/event_logs/
54-
cp data/raw/*user*.log data/processed/user_logs/
55-
56-
# ###7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs
57-
rf -rf ./data
58-
59-
rm -f data/raw/*ipaddr*
60-
rm -f data/processed/user_logs/*ipaddr*
61-
43+
cp raw/*user*.log processed/user_logs/
44+
cp raw/*event*.log processed/event_logs/
45+
# 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs
46+
rm -f raw/*ipaddr*
47+
rm -f processed/user_logs/*ipaddr*
48+
# I resovled merge conflict
6249
# 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed
63-
64-
find data/processed -type f > data/inventory.txt
50+
find processed -type f > inventory.txt
51+
cd ..
6552

6653
###########################################
67-
68-
echo "Project setup is complete done by Anthony Chudee!"
54+
# to run this script: cd to the directory containing assignment.sh and run: bash assignment.sh
55+
echo "Project setup is complete!"

0 commit comments

Comments
 (0)