CYSE 270: Linux System for Cybersecurity Lab 10 – Automation Tasks and shell Scripting CYSE 270: Linux System for Cybersecurity Automate the execution of the script created using Crontab. Task A -...

1 answer below »
screenshot each step like alwaysand my MIDAS is 01106699


CYSE 270: Linux System for Cybersecurity Lab 10 – Automation Tasks and shell Scripting CYSE 270: Linux System for Cybersecurity Automate the execution of the script created using Crontab. Task A - Backup your system (Using crontab) [100 points] Scenario: Performing system backup can be time-consuming, and the process is often overlooked. For this scenario, 1. Create a new user Alice (with home directory) and write a shell script that backups Alice’s home directory, using the following steps: a. Take your MIDAS and current date as input b. Create a tar file in the /var/backups directory. ▪ The filename should be, YourMIDAS-datetime, where date and time are replaced with the current system time (for example, svatsa2021.3.17- 01.16.430.tar). ▪ The tar file should include Alice’s home directory along with the filename created above (for example, svatsa2021.3.17-01.16.430.tar /home/Alice). c. To optimize the disk usage, pick a compression algorithm (bz2, gzip, or xv) to compress the tar file you created. 2. Keep the scheduled task running for 3 minutes, then check the contents in the /var/backupsdirectory. 3. Cancel the crontab jobs. Note: As the script needs to write contents in the “/var/backups” folder, which is owned by root, you should consider the permission issue properly. (Using sudo to create crontab file) Reference: How to Format Date for Display or Use In a Shell Script- https://www.cyberciti.biz/faq/linux- unix-formatting-dates-for-display/ Reference: How to append date timestamp to filename- https://crunchify.com/shell-script-append- timestamp-to-file-name/ https://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/ https://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/ https://crunchify.com/shell-script-append-timestamp-to-file-name/ https://crunchify.com/shell-script-append-timestamp-to-file-name/ CYSE 270: Linux System for Cybersecurity (Extra Credit)- Take your MIDAS/name (10 points) Write a script like below that reads MIDAS/name and displays the message (for example, the screenshot here), if the following requirements are satisfied: 1. Only lower-case letter [a-z] are allowed 2. MIDAS/name must be between 4 to 8 digits Test your script with the following examples: • Your MIDAS /name with one upper case • A string less than 4 digits • A string longer than 8 digits • Your MIDAS/name in lower case, between 4-8 characters in length
Answered Same DayMar 31, 2022

Answer To: CYSE 270: Linux System for Cybersecurity Lab 10 – Automation Tasks and shell Scripting CYSE 270:...

Anandkumar answered on Mar 31 2022
116 Votes
Task 1:Adding user Alice
Run the command below to add user alice
sudo useradd -m alice
"useradd"
adds user to the system "m" parameter is used to create users home directory
Task 2:Shell script that backup Alice’s home directory.
#!/bin/bash
DATE=$(date +%d.%m.%Y-%r) #get date and time of system
FILENAME=alice1.$DATE.$TIME.tar.gz # The filename including the date.
SRCDIR=/home/alice1 # Source backup...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here