Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with Linux. Please see below for the required script. Please note th

ID: 3698924 • Letter: I

Question

I need help with Linux. Please see below for the required script. Please note that directories of NEW, BACKUP and OLD are alreddy complete.

Script: In this section of your final project, you will write a basic script to create and back up files. You will create this script with the vi editor. The script will combine multiple commands and simplify a repeatable task. Your script should be named Firstname Lastname.BASH. Your script and your Linux directory structure should demonstrate that you have correctly written the script to do the following: Create files: In this section, you will demonstrate your ability to utilize various Linux commands to create text files. Create these files in the NEW directory. Ensure that the commands in your log file show that the following three text files were created using three different methods. Create the following files XI A. A text file listing the quantity of operating system free space, titledFree_SpaceContent.txt B. A text file listing the directory contents of the OLD folder, titled OLD Content.txt C. Atext file showing the current month, day, and time (Title this file Time_File.txt.) XII Modify and Move files: Utilize Linux commands to copy files to a different directory and renamethem Copy the following selected files from the OLD directory to the BACKUP directory. Ensure that you change the filename suffix from XXX OLD to XXX BACKUP A. i. FreeSpace_Content OLD.txt ii Directory Content OLD.txt Time_File OLD.txt Move all files from the NEW directory to the BACKUP directory (no renaming necessary). Clean up the Linux directory structure by deleting the items in the NEW directory B. XI Execute the script: At this point, you will need to complete and execute the newlycreated script and complete a successful directorybackupprocess. XIV Assess output: Finally, analyze the Linux directory structure and file contents to confirm successful script implementation. Ensure that you download your script and your Script Assessment.txt file for submission. A. Create a text file titled Script Assessment.txt in the NEW directory; write a paragraph identifying the commands that you used in your script, and assess the success of your script.

Explanation / Answer

ANSWER:

The below description shows with respect to the given data;

##Bash Script Start##

#####Please check the permissions on the folders inorder to make sure the script works

#!/bin/bash

if [ ! -d NEW ]; then

mkdir -p NEW;

fi

df > "NEW/Free_Space_Content.txt"

touch "NEW/OLD_Content.txt" | ls -l OLD > "NEW/OLD_Content.txt"

> "NEW/Time_File.txt" | date +"%B %c" > "NEW/Time_File.txt"

cp "OLD"/*.txt "BACKUP"

rename OLD BACKUP "BACKUP"/*.txt

mv "NEW"/*.txt "BACKUP"

#########Bash Script End##############

########Script_Assessment.txt########

Commands which were used to create files:

touch filename

command > filename

> filename

Directory and its contents:

->NEW: Contained the newly created file

->OLD: Contained sample files with OLD suffix

->BACKUP: Contains all the files moved from NEW and OLD directories

Free_Space_Content.txt contains the disk info such as used and free space

OLD_Content.txt contains the directory contents info of OLD directory

Time_File.txt : Contais the current month, day and time info

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote