From e976b55a5c2a83f4f2ab1221ea228c9b8737db4f Mon Sep 17 00:00:00 2001 From: Simeon Wong Date: Thu, 14 Nov 2024 20:32:09 -0500 Subject: [PATCH 1/5] 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/5] 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 c7d4cf081fa25356b2947265619c458b4bdeff8e Mon Sep 17 00:00:00 2001 From: Sucharitha Date: Wed, 9 Apr 2025 20:26:10 -0400 Subject: [PATCH 3/5] added answer for question 1 on assignment --- 02_activities/assignments/assignment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 2fbb9c81d..7c62dec20 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -21,7 +21,7 @@ unzip -q rawdata.zip # Complete assignment here # 1. Create a directory named data - +mkdir data # 2. Move the ./rawdata directory to ./data/raw # 3. List the contents of the ./data/raw directory From 829623e7da5b00c216e1dd2c1bd6ad5042daa55e Mon Sep 17 00:00:00 2001 From: Sucharitha Date: Thu, 10 Apr 2025 22:31:53 -0400 Subject: [PATCH 4/5] Assignment completed by Sucharitha --- 02_activities/assignments/assignment.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 7c62dec20..7d2c88095 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -23,19 +23,24 @@ unzip -q rawdata.zip # 1. Create a directory named data mkdir data # 2. Move the ./rawdata directory to ./data/raw - +mv assignments/rawdata assignments/data/raw # 3. List the contents of the ./data/raw directory - +ls assignments/data/raw # 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs - +cd data +mkdir processed +cd 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 - +cp raw/*server*.log processed/server_logs # 6. Repeat the above step for user logs and event logs - +cp raw/*user*.log processed/user_logs +cp raw/*event*.log 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 - + rm raw/*ipaddr* +rm processed/user_logs/*ipaddr* # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed - +find processed/ -type f >> ./inventory.txt ########################################### From 5c38f738ff05a22b90aac51d4dc641d5cef244e1 Mon Sep 17 00:00:00 2001 From: Sucharitha Date: Fri, 11 Apr 2025 13:54:54 -0400 Subject: [PATCH 5/5] Modified assignment --- 02_activities/assignments/assignment.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 606b43770..511efa2d8 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -16,7 +16,7 @@ touch analysis/main.py # download client data curl -Lo rawdata.zip https://github.com/UofT-DSI/shell/raw/refs/heads/main/02_activities/assignments/rawdata.zip -unzip -q rawdata.zip +unzip -oq rawdata.zip ########################################### # Complete assignment here @@ -24,14 +24,13 @@ unzip -q rawdata.zip # 1. Create a directory named data mkdir data # 2. Move the ./rawdata directory to ./data/raw -mv assignments/rawdata assignments/data/raw +mv rawdata data/raw # 3. List the contents of the ./data/raw directory -ls assignments/data/raw +ls data/raw # 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs cd data mkdir processed -cd processed -mkdir server_logs user_logs event_logs +mkdir processed/server_logs processed/user_logs processed/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 cp raw/*server*.log processed/server_logs # 6. Repeat the above step for user logs and event logs @@ -42,7 +41,6 @@ rm raw/*ipaddr* rm processed/user_logs/*ipaddr* # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed find processed/ -type f >> ./inventory.txt - ########################################### echo "Project setup is complete!"