From e976b55a5c2a83f4f2ab1221ea228c9b8737db4f Mon Sep 17 00:00:00 2001 From: Simeon Wong Date: Thu, 14 Nov 2024 20:32:09 -0500 Subject: [PATCH 1/8] delete ip logs... WARNING UNTESTED! --- 02_activities/assignments/assignment.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index d81e9a77b..001291867 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -33,6 +33,7 @@ unzip rawdata.zip # 6. Repeat the above step for user logs and event logs # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs +rf -rf ./data # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed From ea20676d33161a6f4d0fcd3c4f7aa5360f0f4309 Mon Sep 17 00:00:00 2001 From: Simeon Wong Date: Thu, 14 Nov 2024 20:55:44 -0500 Subject: [PATCH 2/8] initialize README file with company name --- 02_activities/assignments/assignment.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 001291867..f2bfd22bd 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -11,6 +11,7 @@ set -x mkdir analysis output touch README.md +echo "# Project Name: DSI Consulting Inc." > README.md touch analysis/main.py # download client data From 078ccbfcf605e1cbdaecb7b55927ee725dc72c34 Mon Sep 17 00:00:00 2001 From: Sherry Du Date: Wed, 23 Sep 2026 18:15:54 -0400 Subject: [PATCH 3/8] Completed assignment --- .../assignments/assignment_script.sh | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/02_activities/assignments/assignment_script.sh b/02_activities/assignments/assignment_script.sh index 4b48cec8b..76a2c5fbc 100644 --- a/02_activities/assignments/assignment_script.sh +++ b/02_activities/assignments/assignment_script.sh @@ -1,7 +1,7 @@ #!/bin/bash set -x -############################################ +###cd######################################### # DSI CONSULTING INC. Project setup script # ############################################ # This script creates standard analysis and output directories @@ -29,21 +29,46 @@ unzip -q rawdata.zip # 1. Create a directory named data +mkdir data + # 2. Move the ./rawdata directory to ./data/raw (eg. move it into ./data and rename it to raw) +mv ./rawdata ./data/raw + # 3. List the contents of the ./data/raw directory +ls ./data/raw + # 4. Create the directory ./data/processed, # then create the following sub-directories within it: server_logs, user_logs, and event_logs +mkdir ./data/processed +cd data/processed +mkdir server_logs user_logs event_logs + # 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs +cd ../.. +mv ./data/raw/server*.log ./data/processed/server_logs +ls ./data/processed/server_logs + # 6. Repeat the above step for user logs and event logs +mv ./data/raw/user*.log ./data/processed/user_logs +ls ./data/processed/user_logs + +mv ./data/raw/event*.log ./data/processed/event_logs +ls ./data/processed/event_logs + # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs -# 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed +ls ./data/raw +rm ./data/raw/ipaddr*.txt ./data/processed/user_logs/*ipaddr*.log +ls ./data/raw ./data/processed/user_logs/ +# 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed +ls -R ./data/processed > ./data/inventory.txt +cat ./data/inventory.txt ########################################### From 1f4bd54681f0435ec3cfc673b5571f90f05a0439 Mon Sep 17 00:00:00 2001 From: Sherry Du Date: Sun, 27 Sep 2026 10:31:02 -0400 Subject: [PATCH 4/8] Modified assignment --- .../assignments/assignment_script.sh | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/02_activities/assignments/assignment_script.sh b/02_activities/assignments/assignment_script.sh index 76a2c5fbc..aafb1f49c 100644 --- a/02_activities/assignments/assignment_script.sh +++ b/02_activities/assignments/assignment_script.sh @@ -49,26 +49,26 @@ mkdir server_logs user_logs event_logs # 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs cd ../.. -mv ./data/raw/server*.log ./data/processed/server_logs -ls ./data/processed/server_logs +cp ./data/raw/*server*.log ./data/processed/server_logs +#ls ./data/processed/server_logs # 6. Repeat the above step for user logs and event logs -mv ./data/raw/user*.log ./data/processed/user_logs -ls ./data/processed/user_logs +cp ./data/raw/*user*.log ./data/processed/user_logs +#ls ./data/processed/user_logs -mv ./data/raw/event*.log ./data/processed/event_logs -ls ./data/processed/event_logs +cp ./data/raw/*event*.log ./data/processed/event_logs +#ls ./data/processed/event_logs # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs -ls ./data/raw -rm ./data/raw/ipaddr*.txt ./data/processed/user_logs/*ipaddr*.log -ls ./data/raw ./data/processed/user_logs/ +#ls ./data/raw +rm ./data/raw/ipaddr* ./data/processed/user_logs/*ipaddr* +#ls ./data/raw ./data/processed/user_logs/ # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed ls -R ./data/processed > ./data/inventory.txt -cat ./data/inventory.txt +#cat ./data/inventory.txt ########################################### From 4cf49a511aeeacb0e9393d5a7c50fcbf76e2c2d3 Mon Sep 17 00:00:00 2001 From: Sherry Du Date: Sun, 27 Sep 2026 10:38:47 -0400 Subject: [PATCH 5/8] Fixed small typo --- 02_activities/assignments/assignment_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02_activities/assignments/assignment_script.sh b/02_activities/assignments/assignment_script.sh index aafb1f49c..b2fdfdb4a 100644 --- a/02_activities/assignments/assignment_script.sh +++ b/02_activities/assignments/assignment_script.sh @@ -1,7 +1,7 @@ #!/bin/bash set -x -###cd######################################### +############################################ # DSI CONSULTING INC. Project setup script # ############################################ # This script creates standard analysis and output directories From f33fdbeb5c99187e6197476754ee1a25236d200e Mon Sep 17 00:00:00 2001 From: Sherry Du Date: Sun, 27 Sep 2026 10:47:56 -0400 Subject: [PATCH 6/8] Changed cp to rm --- 02_activities/assignments/assignment_script.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/02_activities/assignments/assignment_script.sh b/02_activities/assignments/assignment_script.sh index b2fdfdb4a..df59add4b 100644 --- a/02_activities/assignments/assignment_script.sh +++ b/02_activities/assignments/assignment_script.sh @@ -49,21 +49,21 @@ mkdir server_logs user_logs event_logs # 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs cd ../.. -cp ./data/raw/*server*.log ./data/processed/server_logs +mv ./data/raw/*server*.log ./data/processed/server_logs #ls ./data/processed/server_logs # 6. Repeat the above step for user logs and event logs -cp ./data/raw/*user*.log ./data/processed/user_logs +mv ./data/raw/*user*.log ./data/processed/user_logs #ls ./data/processed/user_logs -cp ./data/raw/*event*.log ./data/processed/event_logs +mv ./data/raw/*event*.log ./data/processed/event_logs #ls ./data/processed/event_logs # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs #ls ./data/raw -rm ./data/raw/ipaddr* ./data/processed/user_logs/*ipaddr* +rm ./data/raw/*ipaddr* ./data/processed/user_logs/*ipaddr* #ls ./data/raw ./data/processed/user_logs/ # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed From a9be4c3dddd84316890fb6004a48dc9919c17191 Mon Sep 17 00:00:00 2001 From: Sherry Du Date: Sun, 27 Sep 2026 10:55:47 -0400 Subject: [PATCH 7/8] Fix missing files in data/raw --- 02_activities/assignments/assignment_script.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/02_activities/assignments/assignment_script.sh b/02_activities/assignments/assignment_script.sh index df59add4b..49a219065 100644 --- a/02_activities/assignments/assignment_script.sh +++ b/02_activities/assignments/assignment_script.sh @@ -49,15 +49,15 @@ mkdir server_logs user_logs event_logs # 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs cd ../.. -mv ./data/raw/*server*.log ./data/processed/server_logs +cp ./data/raw/*server*.log ./data/processed/server_logs #ls ./data/processed/server_logs # 6. Repeat the above step for user logs and event logs -mv ./data/raw/*user*.log ./data/processed/user_logs +cp ./data/raw/*user*.log ./data/processed/user_logs #ls ./data/processed/user_logs -mv ./data/raw/*event*.log ./data/processed/event_logs +cp ./data/raw/*event*.log ./data/processed/event_logs #ls ./data/processed/event_logs # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs From 594cf927a4f808aeee689039d26b4ad530e8763e Mon Sep 17 00:00:00 2001 From: Sherry Du Date: Tue, 29 Sep 2026 16:24:29 -0400 Subject: [PATCH 8/8] Deleted incorrect coworker code --- 02_activities/assignments/assignment_script.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/02_activities/assignments/assignment_script.sh b/02_activities/assignments/assignment_script.sh index 51669e734..61af7264c 100644 --- a/02_activities/assignments/assignment_script.sh +++ b/02_activities/assignments/assignment_script.sh @@ -62,8 +62,6 @@ cp ./data/raw/*event*.log ./data/processed/event_logs #ls ./data/processed/event_logs # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs -rf -rf ./data - #ls ./data/raw rm ./data/raw/*ipaddr* ./data/processed/user_logs/*ipaddr* #ls ./data/raw ./data/processed/user_logs/