SlideShare a Scribd company logo
1 of 23
Part 4: Scripting and Virtualization (due Week 7)Objectives
1. To learn scripting on Windows and Linux
2. To add virtualization with a Linux distributionStepsPart 1—
Windows Scripting
Basic Script: Scripting is useful for small programming projects
or quick tasks. Often, these programs are short and meant for
small problems. Unlike compiled programming languages,
scripting languages are generally interpreted. Batch files or
scripts are created to automate tasks and may contain several
commands in one file. Scripts can be created in Notepad. These
are short files that run each command in sequence at file
execution. The windows command-line interface can be used to
run scripts.
Below are some commands.
Echo = Displays a message in the batch file
Echo. displays a blank line
@command turns off the display of the current command
@echo off = does not echo back text
cls = clears your screen
:: = Adds comments to your code; this line will not be displayed
Start = used to start a windows application
Creating a Basic Script
cls
@echo off
::Your Name
echo "Creating a data dump file"
ipconfig /all > C:Scriptsconfig_info.txt
echo end of script
Open Notepad by going to Start-> All Programs -> Accessories-
> Notepad.
Type the above script into Notepad.
Create a directory named Scripts on the C: drive. Save this file
in the C:Scripts folder as myscript.cmd.
Do not close your Notepad file. To run, open a command
prompt by typing cmd in the Search Programs and Files box
when you click the Start button or search for cmd.
Change directory to the C:Scripts folder by typing the
following.
cd c:Scripts
Then type in the following.
myscript.cmd
The script should run and will create a file.
Use the dir command to see what files are created.
Keep both the Notepad file and the command prompt open for
the next step.
You can also shut down a computer from a script. This is
helpful for remote shutdown in a networking situation. Add the
following commands to your script and save it in Notepad.
(Note: The ping command, though normally used for
networking, here waits 4 seconds.)
shutdown /s /t 60 /c "Local shutdown in 1 minute!"
ping -w 1000 0.0.0.0 > nul
shutdown /a
echo "Shutdown has been aborted"
Click back to the command prompt.
Type in myscript.cmd to run the script.
You should see the script attempt to shut down, then abort the
shutdown.
Keep both your Notepad and command prompt open.
Environment variables are built-in system variables available
for all Windows processes describing users, paths, and so on.
Some common environment variables are as follows.
%PATH% = contains a list of directories with executable files,
separated by semicolons. To add a path:
SET PATH = %PATH%;C:WindowsEclipse
%DATE% and %TIME% = current date and time
%RANDOM% = returns a random number between 0 and 32767
%WINDIR% = points to the windows directory C:Windows
%PATHEXT% = displays executable file extensions ie .com,
.exe, .bat, .cmd, .vbs, .vbe, .js, .wsf, .wsh
%USERNAME% = the current user
Add the following commands to your script.
echo "The date is "
echo %DATE%
echo "The path is "
echo %PATH%
Run your script in the command prompt.
Now modify the script to display all the files in the directory
(dir command) before the shutdown command and display two
more environment variables.
Take a screenshot of your script after running it and paste it in
the lab report. Also paste your final script.
The next script will be creating a backup script. In order to do
this you will need to determine what files you want to back up,
and the destination. You may want to back up school files,
pictures, important documents, and so on. The files you will
backup will need to be in a specific folder (i.e.,
C:UsersSusieDocumentsFiles). Then you will need a separate
place to back up your data. It could be a separate folder on your
C: drive, or it could be an external drive or USB drive.
You will also give your backup folder a custom name with the
date. However, to do this you will need to strip out the / signs
in the date. If you keep the / signs in the date, then when you
create your backup folder there will be several subfolders. For
example, see the date below:
If we were to make a folder with the name backup_%date% it
would have a confusing set of spaces and slashes:
So we need to strip out the month, day, and year. We do this by
extracting a position and number of characters. So this
command: %date:~4,2% will start at the fourth character and
extract two characters with the result of 07. To pull out the
month, day, and year, use the following command.
%date:~4,2%%date:~7,2%%date:~10,4%
We will use this to create our backup folder name.
Next, we will use the xcopy command to copy all files and
subdirectories. The xcopy command works like this: xcopy
source destination
So if you want to copy files from your
C:usersginaDocumentswork to your E:backup (E: is the
USB drive in this case) you would use this command: xcopy
C:usersginaDocumentswork* E:backup* /S /Y /I
Note that switch S will copy all files and folders including
subfolders, Y will overwrite files and not ask for confirmation,
I will automatically create subfolders.
Below is an example backup script. Replace Sheldon Cooper
with your own name and replace the pathnames of the source
and destination.
Take a screenshot of your script and paste it in the lab report.
Also paste a screenshot showing your folder created for your
backup.
Part 2 Linux Virtualization and Scripting
For this part of the lab, we will be using the Linux operating
system. If you do not have a Linux environment, you can set
one up using VMWare using the steps below:
1. Install VMware workstation player on your computer.
Download the install files and work through the wizard to
install VMware.
https://www.vmware.com/products/workstation-
player/workstation-player-evaluation.html
2. Download the linux iso from the Files section of your course.
It is named: ubuntu-18.04.1-desktop-amd64.iso This is a
distribution of Linux named Ubuntu. Copy the file downloaded
to a folder so you will remember where it is stored. I created a
folder named Ubuntu and copied the file in there.
Figure 2: Linux ISO
3. Next open VMWare and click the “Create a New Virtual
Machine”
Figure 3: New Virtual machine
4. Choose the Installer disk file and browse for the location of
Ubuntu:
Figure 4: Browse for disc file
5. Personalize Ubuntu with your name and password.
IMPORTANT: write down your password so you will remember
it
Figure 5: Personalize Linux
6. Follow the rest of the defaults to install the Linux image.
You may get this virtualization error:
Figure 6: Virtualization error
7. If you get this virtualization error, you will need to go to the
BIOS and enable virtualization.
8. Once Linux is installed explore the desktop
Figure 7: Applications
9. Click on the 9 dots on the lower left corner to see all of the
applications.
Basic Script: We will be writing a script to create a directory
and create a file within that directory. The file we will create
will be the output of the ifconfig command. This command is
similar to the ipconfig in Windows. We will direct the output of
the ifconfig command into a new file using the file redirect >.
First we must install the net-tools.
Open the Terminal Window (it is one of the programs you see
when you click on the 9 dots). Click on Terminal to open the
terminal window
At the terminal window type type the following command:
sudo apt install net-tools
When it is finished updating the net-tools you will see the
prompt again:
Next, we will write a script we will use the nano editor.
At the Linux prompt, enter this command.
nano create.sh
Type in the following (please note the ls—l has two lowercase
Ls):
#This script named create.sh creates a directory and a file
mkdir newDir
echo “This is a script to create a directory”
ls -l # “l” as in larry, “s” as in sam, then minus sign then
“l” as in larry
ifconfig > ./newDir/config.txt
To save the file, press Control and O. Press enter to confirm the
name. The ^ symbol in nano stands for the control key. Press
Control and X to exit.
To run a script type the following.
./create.sh
However, you will receive a permission denied error.
You will need to change permissions using the chmod
command.
Type in the following command.
chmod 755 create.sh
Now try to run the script with the following.
./create.sh
Now that your script has run and created a file for you
automatically, let's check the contents of that file. It is located
in the newDir directory. Change directory to newDir and then
use cat to view the contents of the config.txt file. The
commands are below.
cd newDir
cat config.txt
Take a screenshot of the script and the result of running the
script. To view the script, you will need to move to the parent
directory out of newDir. To do this, type this command.
cd ..
Then either open the editor again (nano create.sh) or type cat
create.sh at the command prompt.
Paste the screenshot of the script and the result of running the
script in the lab report.
Next, we will set up our linux VM as a web server. Instructions
will also follow below.
In order to set up the linux VM as a web server, it must be
connected to the Internet. The first thing needed is the IP
address of your linux machine. Type the command below.
ifconfig
Look at the inet addr. This is the IP address. In the screenshot
above, the IP address is 192.168.93.128.
Then you will need to update your Raspberry Pi and install
Apache. Use the following commands.
sudo apt-get update
sudo apt-get install apache2
This will take several minutes to install, and you may need to
type Y to accept the install.
Next, go to a browser (on your linux VM – you will see Firefox
in the upper left corner) and type in the IP address of the linux
vm into the address bar.
You should get a message that it works!
http://192.168.93.128
Now let's modify the index.html page that you are viewing. Go
back to the terminal window and navigate to the /var/www/html
folder. Then type the ls command (lower case L) and you should
see one file: index.html
cd /var/www/html
ls
Now we will modify index.html. We will modify just a few
lines but if you have experience with html or would like to learn
and play with it, you are welcome to modify as much as you
want! To edit the index.html file type in the following command
to open the nano editor.
sudo nano index.html
This is the current code. Feel free to modify it. Change the title
from “Apache 2 Ubuntu Default Page: It Works” to your name.
Change what is between the <title> and </title>
Save the file using ctrl + o. Then exit with ctrl + x.
Open the web browser and type in the IP address of the pi into
the address bar and you should see the new page. My page
below has been changed quite a bit:
Paste the screenshot of your site in the lab report showing the
IP address.
Deliverables Part 4
· Complete the Course Project Report
· Include the pictures and descriptions required in the
explanation above
Part 5: Hardware and Software Presentation (due Week 8)
· Create a Powerpoint Presentation with at least 10 slides.
Include an Introduction, Challenges, Career Skills Learned, and
a Conclusion slide
· Create a video and or powerpoint presentation showing your
project – all parts. An example video is here:
https://lms.devry.edu/lms/video/player.html?video=1_xncbxdzb
· Submit powerpoint and link to your video
Part 4: Scripting and Virtualization (due Week 7)Objectives
1. To learn scripting on Windows and Linux
2. To add virtualization with a Linux distributionStepsPart 1—
Windows Scripting
Basic Script: Scripting is useful for small programming projects
or quick tasks. Often, these programs are short and meant for
small problems. Unlike compiled programming languages,
scripting languages are generally interpreted. Batch files or
scripts are created to automate tasks and may contain several
commands in one file. Scripts can be created in Notepad. These
are short files that run each command in sequence at file
execution. The windows command-line interface can be used to
run scripts.
Below are some commands.
Echo = Displays a message in the batch file
Echo. displays a blank line
@command turns off the display of the current command
@echo off = does not echo back text
cls = clears your screen
:: = Adds comments to your code; this line will not be displayed
Start = used to start a windows application
Creating a Basic Script
cls
@echo off
::Your Name
echo "Creating a data dump file"
ipconfig /all > C:Scriptsconfig_info.txt
echo end of script
Open Notepad by going to Start-> All Programs -> Accessories-
> Notepad.
Type the above script into Notepad.
Create a directory named Scripts on the C: drive. Save this file
in the C:Scripts folder as myscript.cmd.
Do not close your Notepad file. To run, open a command
prompt by typing cmd in the Search Programs and Files box
when you click the Start button or search for cmd.
Change directory to the C:Scripts folder by typing the
following.
cd c:Scripts
Then type in the following.
myscript.cmd
The script should run and will create a file.
Use the dir command to see what files are created.
Keep both the Notepad file and the command prompt open for
the next step.
You can also shut down a computer from a script. This is
helpful for remote shutdown in a networking situation. Add the
following commands to your script and save it in Notepad.
(Note: The ping command, though normally used for
networking, here waits 4 seconds.)
shutdown /s /t 60 /c "Local shutdown in 1 minute!"
ping -w 1000 0.0.0.0 > nul
shutdown /a
echo "Shutdown has been aborted"
Click back to the command prompt.
Type in myscript.cmd to run the script.
You should see the script attempt to shut down, then abort the
shutdown.
Keep both your Notepad and command prompt open.
Environment variables are built-in system variables available
for all Windows processes describing users, paths, and so on.
Some common environment variables are as follows.
%PATH% = contains a list of directories with executable files,
separated by semicolons. To add a path:
SET PATH = %PATH%;C:WindowsEclipse
%DATE% and %TIME% = current date and time
%RANDOM% = returns a random number between 0 and 32767
%WINDIR% = points to the windows directory C:Windows
%PATHEXT% = displays executable file extensions ie .com,
.exe, .bat, .cmd, .vbs, .vbe, .js, .wsf, .wsh
%USERNAME% = the current user
Add the following commands to your script.
echo "The date is "
echo %DATE%
echo "The path is "
echo %PATH%
Run your script in the command prompt.
Now modify the script to display all the files in the directory
(dir command) before the shutdown command and display two
more environment variables.
Take a screenshot of your script after running it and paste it in
the lab report. Also paste your final script.
The next script will be creating a backup script. In order to do
this you will need to determine what files you want to back up,
and the destination. You may want to back up school files,
pictures, important documents, and so on. The files you will
backup will need to be in a specific folder (i.e.,
C:UsersSusieDocumentsFiles). Then you will need a separate
place to back up your data. It could be a separate folder on your
C: drive, or it could be an external drive or USB drive.
You will also give your backup folder a custom name with the
date. However, to do this you will need to strip out the / signs
in the date. If you keep the / signs in the date, then when you
create your backup folder there will be several subfolders. For
example, see the date below:
If we were to make a folder with the name backup_%date% it
would have a confusing set of spaces and slashes:
So we need to strip out the month, day, and year. We do this by
extracting a position and number of characters. So this
command: %date:~4,2% will start at the fourth character and
extract two characters with the result of 07. To pull out the
month, day, and year, use the following command.
%date:~4,2%%date:~7,2%%date:~10,4%
We will use this to create our backup folder name.
Next, we will use the xcopy command to copy all files and
subdirectories. The xcopy command works like this: xcopy
source destination
So if you want to copy files from your
C:usersginaDocumentswork to your E:backup (E: is the
USB drive in this case) you would use this command: xcopy
C:usersginaDocumentswork* E:backup* /S /Y /I
Note that switch S will copy all files and folders including
subfolders, Y will overwrite files and not ask for confirmation,
I will automatically create subfolders.
Below is an example backup script. Replace Sheldon Cooper
with your own name and replace the pathnames of the source
and destination.
Take a screenshot of your script and paste it in the lab report.
Also paste a screenshot showing your folder created for your
backup.
Part 2 Linux Virtualization and Scripting
For this part of the lab, we will be using the Linux operating
system. If you do not have a Linux environment, you can set
one up using VMWare using the steps below:
1. Install VMware workstation player on your computer.
Download the install files and work through the wizard to
install VMware.
https://www.vmware.com/products/workstation-
player/workstation-player-evaluation.html
2. Download the linux iso from the Files section of your course.
It is named: ubuntu-18.04.1-desktop-amd64.iso This is a
distribution of Linux named Ubuntu. Copy the file downloaded
to a folder so you will remember where it is stored. I created a
folder named Ubuntu and copied the file in there.
Figure 2: Linux ISO
3. Next open VMWare and click the “Create a New Virtual
Machine”
Figure 3: New Virtual machine
4. Choose the Installer disk file and browse for the location of
Ubuntu:
Figure 4: Browse for disc file
5. Personalize Ubuntu with your name and password.
IMPORTANT: write down your password so you will remember
it
Figure 5: Personalize Linux
6. Follow the rest of the defaults to install the Linux image.
You may get this virtualization error:
Figure 6: Virtualization error
7. If you get this virtualization error, you will need to go to the
BIOS and enable virtualization.
8. Once Linux is installed explore the desktop
Figure 7: Applications
9. Click on the 9 dots on the lower left corner to see all of the
applications.
Basic Script: We will be writing a script to create a directory
and create a file within that directory. The file we will create
will be the output of the ifconfig command. This command is
similar to the ipconfig in Windows. We will direct the output of
the ifconfig command into a new file using the file redirect >.
First we must install the net-tools.
Open the Terminal Window (it is one of the programs you see
when you click on the 9 dots). Click on Terminal to open the
terminal window
At the terminal window type type the following command:
sudo apt install net-tools
When it is finished updating the net-tools you will see the
prompt again:
Next, we will write a script we will use the nano editor.
At the Linux prompt, enter this command.
nano create.sh
Type in the following (please note the ls—l has two lowercase
Ls):
#This script named create.sh creates a directory and a file
mkdir newDir
echo “This is a script to create a directory”
ls -l # “l” as in larry, “s” as in sam, then minus sign then
“l” as in larry
ifconfig > ./newDir/config.txt
To save the file, press Control and O. Press enter to confirm the
name. The ^ symbol in nano stands for the control key. Press
Control and X to exit.
To run a script type the following.
./create.sh
However, you will receive a permission denied error.
You will need to change permissions using the chmod
command.
Type in the following command.
chmod 755 create.sh
Now try to run the script with the following.
./create.sh
Now that your script has run and created a file for you
automatically, let's check the contents of that file. It is located
in the newDir directory. Change directory to newDir and then
use cat to view the contents of the config.txt file. The
commands are below.
cd newDir
cat config.txt
Take a screenshot of the script and the result of running the
script. To view the script, you will need to move to the parent
directory out of newDir. To do this, type this command.
cd ..
Then either open the editor again (nano create.sh) or type cat
create.sh at the command prompt.
Paste the screenshot of the script and the result of running the
script in the lab report.
Next, we will set up our linux VM as a web server. Instructions
will also follow below.
In order to set up the linux VM as a web server, it must be
connected to the Internet. The first thing needed is the IP
address of your linux machine. Type the command below.
ifconfig
Look at the inet addr. This is the IP address. In the screenshot
above, the IP address is 192.168.93.128.
Then you will need to update your Raspberry Pi and install
Apache. Use the following commands.
sudo apt-get update
sudo apt-get install apache2
This will take several minutes to install, and you may need to
type Y to accept the install.
Next, go to a browser (on your linux VM – you will see Firefox
in the upper left corner) and type in the IP address of the linux
vm into the address bar.
You should get a message that it works!
http://192.168.93.128
Now let's modify the index.html page that you are viewing. Go
back to the terminal window and navigate to the /var/www/html
folder. Then type the ls command (lower case L) and you should
see one file: index.html
cd /var/www/html
ls
Now we will modify index.html. We will modify just a few
lines but if you have experience with html or would like to learn
and play with it, you are welcome to modify as much as you
want! To edit the index.html file type in the following command
to open the nano editor.
sudo nano index.html
This is the current code. Feel free to modify it. Change the title
from “Apache 2 Ubuntu Default Page: It Works” to your name.
Change what is between the <title> and </title>
Save the file using ctrl + o. Then exit with ctrl + x.
Open the web browser and type in the IP address of the pi into
the address bar and you should see the new page. My page
below has been changed quite a bit:
Paste the screenshot of your site in the lab report showing the
IP address.
Deliverables Part 4
· Complete the Course Project Report
· Include the pictures and descriptions required in the
explanation above
Part 5: Hardware and Software Presentation (due Week 8)
· Create a Powerpoint Presentation with at least 10 slides.
Include an Introduction, Challenges, Career Skills Learned, and
a Conclusion slide
· Create a video and or powerpoint presentation showing your
project – all parts. An example video is here:
https://lms.devry.edu/lms/video/player.html?video=1_xncbxdzb
· Submit powerpoint and link to your video
CIS206 Course Project Report
TCO 5: Given a business requirement requiring the writing of a
script or a command file, develop a script or command program
that meets the specified business requirement for administrators
or programmers.
The instructions for this project are located in the Course Home.
Rubric
Point Distribution for This Project
Project activities
Document
Points Possible
Points Received
Part 1: Windows Basic Script
15
Part 2: Windows Backup Script
20
Part 3: Linux Basic Script
15
Part 4: Linux Web Server
20
Total Points
70
1—Windows Script: Basic Script
Script screenshot:
After running script screenshot:
2—Windows Script: Backup Script
Script screenshot:
Folder showing backup screenshot:
3—Linux Script: Basic Script
Script screenshot:
After running script screenshot:
4—Linux Script: Web Server
Screenshot of the site showing the IP address:

More Related Content

Similar to Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx

Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows Boxguest34a3a419
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows BoxJayanta Dash
 
Final opensource record 2019
Final opensource record 2019Final opensource record 2019
Final opensource record 2019Karthik Sekhar
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...Jim Birch
 
Linux Command Line Basics
Linux Command Line BasicsLinux Command Line Basics
Linux Command Line BasicsWe Ihaveapc
 
I Am Linux-Introductory Module on Linux
I Am Linux-Introductory Module on LinuxI Am Linux-Introductory Module on Linux
I Am Linux-Introductory Module on LinuxSagar Kumar
 
Making%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20WindowsMaking%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20Windowstutorialsruby
 
Making%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20WindowsMaking%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20Windowstutorialsruby
 
Apache Kafka Setup with Zookeeper - SkillAnything.pdf
Apache Kafka Setup with Zookeeper - SkillAnything.pdfApache Kafka Setup with Zookeeper - SkillAnything.pdf
Apache Kafka Setup with Zookeeper - SkillAnything.pdfSkillAnything
 
Installing Hortonworks Hadoop for Windows
Installing Hortonworks Hadoop for WindowsInstalling Hortonworks Hadoop for Windows
Installing Hortonworks Hadoop for WindowsJonathan Bloom
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool boxbpowell29a
 
Creating a Scheduled Backup and Replicating System Folders Introduct.docx
Creating a Scheduled Backup and Replicating System Folders Introduct.docxCreating a Scheduled Backup and Replicating System Folders Introduct.docx
Creating a Scheduled Backup and Replicating System Folders Introduct.docxwilliejgrant41084
 

Similar to Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx (20)

Experimentos lab
Experimentos labExperimentos lab
Experimentos lab
 
Linux
LinuxLinux
Linux
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows Box
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows Box
 
Final opensource record 2019
Final opensource record 2019Final opensource record 2019
Final opensource record 2019
 
Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
 
Linux basic
Linux basicLinux basic
Linux basic
 
Apache Web Server Setup 2
Apache Web Server Setup 2Apache Web Server Setup 2
Apache Web Server Setup 2
 
Linux Command Line Basics
Linux Command Line BasicsLinux Command Line Basics
Linux Command Line Basics
 
I Am Linux-Introductory Module on Linux
I Am Linux-Introductory Module on LinuxI Am Linux-Introductory Module on Linux
I Am Linux-Introductory Module on Linux
 
Linuxs1
Linuxs1Linuxs1
Linuxs1
 
Making%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20WindowsMaking%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20Windows
 
Making%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20WindowsMaking%20R%20Packages%20Under%20Windows
Making%20R%20Packages%20Under%20Windows
 
Book
BookBook
Book
 
Linux
LinuxLinux
Linux
 
Apache Kafka Setup with Zookeeper - SkillAnything.pdf
Apache Kafka Setup with Zookeeper - SkillAnything.pdfApache Kafka Setup with Zookeeper - SkillAnything.pdf
Apache Kafka Setup with Zookeeper - SkillAnything.pdf
 
Sun raysetup
Sun raysetupSun raysetup
Sun raysetup
 
Installing Hortonworks Hadoop for Windows
Installing Hortonworks Hadoop for WindowsInstalling Hortonworks Hadoop for Windows
Installing Hortonworks Hadoop for Windows
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 
Creating a Scheduled Backup and Replicating System Folders Introduct.docx
Creating a Scheduled Backup and Replicating System Folders Introduct.docxCreating a Scheduled Backup and Replicating System Folders Introduct.docx
Creating a Scheduled Backup and Replicating System Folders Introduct.docx
 

More from karlhennesey

Resources Assigned readings, ERRs, the Internet,and other resources.docx
Resources Assigned readings, ERRs, the Internet,and other resources.docxResources Assigned readings, ERRs, the Internet,and other resources.docx
Resources Assigned readings, ERRs, the Internet,and other resources.docxkarlhennesey
 
Resource Review Documenting the Face of America Roy Stryker and.docx
Resource Review Documenting the Face of America Roy Stryker and.docxResource Review Documenting the Face of America Roy Stryker and.docx
Resource Review Documenting the Face of America Roy Stryker and.docxkarlhennesey
 
Resource Review Thelma Golden--How Art Gives Shape to Cultural C.docx
Resource Review Thelma Golden--How Art Gives Shape to Cultural C.docxResource Review Thelma Golden--How Art Gives Shape to Cultural C.docx
Resource Review Thelma Golden--How Art Gives Shape to Cultural C.docxkarlhennesey
 
Resource Review Representational Cityscape, and Ch. 3 of Oxfo.docx
Resource Review Representational Cityscape, and Ch. 3 of Oxfo.docxResource Review Representational Cityscape, and Ch. 3 of Oxfo.docx
Resource Review Representational Cityscape, and Ch. 3 of Oxfo.docxkarlhennesey
 
Resource Part 2 of Terrorism TodayYou work on a national se.docx
Resource Part 2 of Terrorism TodayYou work on a national se.docxResource Part 2 of Terrorism TodayYou work on a national se.docx
Resource Part 2 of Terrorism TodayYou work on a national se.docxkarlhennesey
 
Resources Appendix A, The Home Depot, Inc. Annual Report in Fun.docx
Resources Appendix A, The Home Depot, Inc. Annual Report in Fun.docxResources Appendix A, The Home Depot, Inc. Annual Report in Fun.docx
Resources Appendix A, The Home Depot, Inc. Annual Report in Fun.docxkarlhennesey
 
Resources Annotated Bibliography document. Research five websites t.docx
Resources Annotated Bibliography document. Research five websites t.docxResources Annotated Bibliography document. Research five websites t.docx
Resources Annotated Bibliography document. Research five websites t.docxkarlhennesey
 
Resources American History, Primary Source Investigator;Cente.docx
Resources American History, Primary Source Investigator;Cente.docxResources American History, Primary Source Investigator;Cente.docx
Resources American History, Primary Source Investigator;Cente.docxkarlhennesey
 
Resource University of Phoenix Material Data SetDownload the.docx
Resource University of Phoenix Material Data SetDownload the.docxResource University of Phoenix Material Data SetDownload the.docx
Resource University of Phoenix Material Data SetDownload the.docxkarlhennesey
 
Resource Ch. 6 & 7 of Financial AccountingComplete Brief Ex.docx
Resource Ch. 6 & 7 of Financial AccountingComplete Brief Ex.docxResource Ch. 6 & 7 of Financial AccountingComplete Brief Ex.docx
Resource Ch. 6 & 7 of Financial AccountingComplete Brief Ex.docxkarlhennesey
 
Resource Films on DemandCrime and Punishment”Experiment Res.docx
Resource Films on DemandCrime and Punishment”Experiment Res.docxResource Films on DemandCrime and Punishment”Experiment Res.docx
Resource Films on DemandCrime and Punishment”Experiment Res.docxkarlhennesey
 
Resource Managing Environmental Issues Simulation(or research a.docx
Resource Managing Environmental Issues Simulation(or research a.docxResource Managing Environmental Issues Simulation(or research a.docx
Resource Managing Environmental Issues Simulation(or research a.docxkarlhennesey
 
Resource Ch. 9 of Introduction to Business Create a 5-to-7 slide .docx
Resource Ch. 9 of Introduction to Business Create a 5-to-7 slide .docxResource Ch. 9 of Introduction to Business Create a 5-to-7 slide .docx
Resource Ch. 9 of Introduction to Business Create a 5-to-7 slide .docxkarlhennesey
 
Resource Ch. 9 of Introduction to Business Complete the table in .docx
Resource Ch. 9 of Introduction to Business Complete the table in .docxResource Ch. 9 of Introduction to Business Complete the table in .docx
Resource Ch. 9 of Introduction to Business Complete the table in .docxkarlhennesey
 
Resource Ch. 3 of ManagementIdentify a time in your life wh.docx
Resource Ch. 3 of ManagementIdentify a time in your life wh.docxResource Ch. 3 of ManagementIdentify a time in your life wh.docx
Resource Ch. 3 of ManagementIdentify a time in your life wh.docxkarlhennesey
 
Resource Significant Health Care Event Paper Grading Criteria.docx
Resource Significant Health Care Event Paper Grading Criteria.docxResource Significant Health Care Event Paper Grading Criteria.docx
Resource Significant Health Care Event Paper Grading Criteria.docxkarlhennesey
 
Resource Ch. 3 of Financial AccountingComplete Exercises E3.docx
Resource Ch. 3 of Financial AccountingComplete Exercises E3.docxResource Ch. 3 of Financial AccountingComplete Exercises E3.docx
Resource Ch. 3 of Financial AccountingComplete Exercises E3.docxkarlhennesey
 
Resource University of Phoenix Material Appendix AIdentify.docx
Resource University of Phoenix Material Appendix AIdentify.docxResource University of Phoenix Material Appendix AIdentify.docx
Resource University of Phoenix Material Appendix AIdentify.docxkarlhennesey
 
Resource The Threat of Bioterrorism VideoWrite a 700 to 850-w.docx
Resource The Threat of Bioterrorism VideoWrite a 700 to 850-w.docxResource The Threat of Bioterrorism VideoWrite a 700 to 850-w.docx
Resource The Threat of Bioterrorism VideoWrite a 700 to 850-w.docxkarlhennesey
 
Resource Ch. 14 of Introduction to Psychology Create an 8 to 12 s.docx
Resource Ch. 14 of Introduction to Psychology Create an 8 to 12 s.docxResource Ch. 14 of Introduction to Psychology Create an 8 to 12 s.docx
Resource Ch. 14 of Introduction to Psychology Create an 8 to 12 s.docxkarlhennesey
 

More from karlhennesey (20)

Resources Assigned readings, ERRs, the Internet,and other resources.docx
Resources Assigned readings, ERRs, the Internet,and other resources.docxResources Assigned readings, ERRs, the Internet,and other resources.docx
Resources Assigned readings, ERRs, the Internet,and other resources.docx
 
Resource Review Documenting the Face of America Roy Stryker and.docx
Resource Review Documenting the Face of America Roy Stryker and.docxResource Review Documenting the Face of America Roy Stryker and.docx
Resource Review Documenting the Face of America Roy Stryker and.docx
 
Resource Review Thelma Golden--How Art Gives Shape to Cultural C.docx
Resource Review Thelma Golden--How Art Gives Shape to Cultural C.docxResource Review Thelma Golden--How Art Gives Shape to Cultural C.docx
Resource Review Thelma Golden--How Art Gives Shape to Cultural C.docx
 
Resource Review Representational Cityscape, and Ch. 3 of Oxfo.docx
Resource Review Representational Cityscape, and Ch. 3 of Oxfo.docxResource Review Representational Cityscape, and Ch. 3 of Oxfo.docx
Resource Review Representational Cityscape, and Ch. 3 of Oxfo.docx
 
Resource Part 2 of Terrorism TodayYou work on a national se.docx
Resource Part 2 of Terrorism TodayYou work on a national se.docxResource Part 2 of Terrorism TodayYou work on a national se.docx
Resource Part 2 of Terrorism TodayYou work on a national se.docx
 
Resources Appendix A, The Home Depot, Inc. Annual Report in Fun.docx
Resources Appendix A, The Home Depot, Inc. Annual Report in Fun.docxResources Appendix A, The Home Depot, Inc. Annual Report in Fun.docx
Resources Appendix A, The Home Depot, Inc. Annual Report in Fun.docx
 
Resources Annotated Bibliography document. Research five websites t.docx
Resources Annotated Bibliography document. Research five websites t.docxResources Annotated Bibliography document. Research five websites t.docx
Resources Annotated Bibliography document. Research five websites t.docx
 
Resources American History, Primary Source Investigator;Cente.docx
Resources American History, Primary Source Investigator;Cente.docxResources American History, Primary Source Investigator;Cente.docx
Resources American History, Primary Source Investigator;Cente.docx
 
Resource University of Phoenix Material Data SetDownload the.docx
Resource University of Phoenix Material Data SetDownload the.docxResource University of Phoenix Material Data SetDownload the.docx
Resource University of Phoenix Material Data SetDownload the.docx
 
Resource Ch. 6 & 7 of Financial AccountingComplete Brief Ex.docx
Resource Ch. 6 & 7 of Financial AccountingComplete Brief Ex.docxResource Ch. 6 & 7 of Financial AccountingComplete Brief Ex.docx
Resource Ch. 6 & 7 of Financial AccountingComplete Brief Ex.docx
 
Resource Films on DemandCrime and Punishment”Experiment Res.docx
Resource Films on DemandCrime and Punishment”Experiment Res.docxResource Films on DemandCrime and Punishment”Experiment Res.docx
Resource Films on DemandCrime and Punishment”Experiment Res.docx
 
Resource Managing Environmental Issues Simulation(or research a.docx
Resource Managing Environmental Issues Simulation(or research a.docxResource Managing Environmental Issues Simulation(or research a.docx
Resource Managing Environmental Issues Simulation(or research a.docx
 
Resource Ch. 9 of Introduction to Business Create a 5-to-7 slide .docx
Resource Ch. 9 of Introduction to Business Create a 5-to-7 slide .docxResource Ch. 9 of Introduction to Business Create a 5-to-7 slide .docx
Resource Ch. 9 of Introduction to Business Create a 5-to-7 slide .docx
 
Resource Ch. 9 of Introduction to Business Complete the table in .docx
Resource Ch. 9 of Introduction to Business Complete the table in .docxResource Ch. 9 of Introduction to Business Complete the table in .docx
Resource Ch. 9 of Introduction to Business Complete the table in .docx
 
Resource Ch. 3 of ManagementIdentify a time in your life wh.docx
Resource Ch. 3 of ManagementIdentify a time in your life wh.docxResource Ch. 3 of ManagementIdentify a time in your life wh.docx
Resource Ch. 3 of ManagementIdentify a time in your life wh.docx
 
Resource Significant Health Care Event Paper Grading Criteria.docx
Resource Significant Health Care Event Paper Grading Criteria.docxResource Significant Health Care Event Paper Grading Criteria.docx
Resource Significant Health Care Event Paper Grading Criteria.docx
 
Resource Ch. 3 of Financial AccountingComplete Exercises E3.docx
Resource Ch. 3 of Financial AccountingComplete Exercises E3.docxResource Ch. 3 of Financial AccountingComplete Exercises E3.docx
Resource Ch. 3 of Financial AccountingComplete Exercises E3.docx
 
Resource University of Phoenix Material Appendix AIdentify.docx
Resource University of Phoenix Material Appendix AIdentify.docxResource University of Phoenix Material Appendix AIdentify.docx
Resource University of Phoenix Material Appendix AIdentify.docx
 
Resource The Threat of Bioterrorism VideoWrite a 700 to 850-w.docx
Resource The Threat of Bioterrorism VideoWrite a 700 to 850-w.docxResource The Threat of Bioterrorism VideoWrite a 700 to 850-w.docx
Resource The Threat of Bioterrorism VideoWrite a 700 to 850-w.docx
 
Resource Ch. 14 of Introduction to Psychology Create an 8 to 12 s.docx
Resource Ch. 14 of Introduction to Psychology Create an 8 to 12 s.docxResource Ch. 14 of Introduction to Psychology Create an 8 to 12 s.docx
Resource Ch. 14 of Introduction to Psychology Create an 8 to 12 s.docx
 

Recently uploaded

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 

Recently uploaded (20)

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 

Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx

  • 1. Part 4: Scripting and Virtualization (due Week 7)Objectives 1. To learn scripting on Windows and Linux 2. To add virtualization with a Linux distributionStepsPart 1— Windows Scripting Basic Script: Scripting is useful for small programming projects or quick tasks. Often, these programs are short and meant for small problems. Unlike compiled programming languages, scripting languages are generally interpreted. Batch files or scripts are created to automate tasks and may contain several commands in one file. Scripts can be created in Notepad. These are short files that run each command in sequence at file execution. The windows command-line interface can be used to run scripts. Below are some commands. Echo = Displays a message in the batch file Echo. displays a blank line @command turns off the display of the current command @echo off = does not echo back text cls = clears your screen :: = Adds comments to your code; this line will not be displayed Start = used to start a windows application Creating a Basic Script cls @echo off ::Your Name echo "Creating a data dump file" ipconfig /all > C:Scriptsconfig_info.txt echo end of script Open Notepad by going to Start-> All Programs -> Accessories- > Notepad. Type the above script into Notepad.
  • 2. Create a directory named Scripts on the C: drive. Save this file in the C:Scripts folder as myscript.cmd. Do not close your Notepad file. To run, open a command prompt by typing cmd in the Search Programs and Files box when you click the Start button or search for cmd. Change directory to the C:Scripts folder by typing the following. cd c:Scripts Then type in the following. myscript.cmd The script should run and will create a file. Use the dir command to see what files are created. Keep both the Notepad file and the command prompt open for the next step. You can also shut down a computer from a script. This is helpful for remote shutdown in a networking situation. Add the following commands to your script and save it in Notepad. (Note: The ping command, though normally used for networking, here waits 4 seconds.) shutdown /s /t 60 /c "Local shutdown in 1 minute!" ping -w 1000 0.0.0.0 > nul
  • 3. shutdown /a echo "Shutdown has been aborted" Click back to the command prompt. Type in myscript.cmd to run the script. You should see the script attempt to shut down, then abort the shutdown. Keep both your Notepad and command prompt open. Environment variables are built-in system variables available for all Windows processes describing users, paths, and so on. Some common environment variables are as follows. %PATH% = contains a list of directories with executable files, separated by semicolons. To add a path: SET PATH = %PATH%;C:WindowsEclipse %DATE% and %TIME% = current date and time %RANDOM% = returns a random number between 0 and 32767 %WINDIR% = points to the windows directory C:Windows %PATHEXT% = displays executable file extensions ie .com, .exe, .bat, .cmd, .vbs, .vbe, .js, .wsf, .wsh %USERNAME% = the current user Add the following commands to your script. echo "The date is " echo %DATE% echo "The path is " echo %PATH% Run your script in the command prompt. Now modify the script to display all the files in the directory (dir command) before the shutdown command and display two
  • 4. more environment variables. Take a screenshot of your script after running it and paste it in the lab report. Also paste your final script. The next script will be creating a backup script. In order to do this you will need to determine what files you want to back up, and the destination. You may want to back up school files, pictures, important documents, and so on. The files you will backup will need to be in a specific folder (i.e., C:UsersSusieDocumentsFiles). Then you will need a separate place to back up your data. It could be a separate folder on your C: drive, or it could be an external drive or USB drive. You will also give your backup folder a custom name with the date. However, to do this you will need to strip out the / signs in the date. If you keep the / signs in the date, then when you create your backup folder there will be several subfolders. For example, see the date below: If we were to make a folder with the name backup_%date% it would have a confusing set of spaces and slashes: So we need to strip out the month, day, and year. We do this by extracting a position and number of characters. So this command: %date:~4,2% will start at the fourth character and extract two characters with the result of 07. To pull out the month, day, and year, use the following command. %date:~4,2%%date:~7,2%%date:~10,4% We will use this to create our backup folder name. Next, we will use the xcopy command to copy all files and subdirectories. The xcopy command works like this: xcopy source destination So if you want to copy files from your C:usersginaDocumentswork to your E:backup (E: is the USB drive in this case) you would use this command: xcopy
  • 5. C:usersginaDocumentswork* E:backup* /S /Y /I Note that switch S will copy all files and folders including subfolders, Y will overwrite files and not ask for confirmation, I will automatically create subfolders. Below is an example backup script. Replace Sheldon Cooper with your own name and replace the pathnames of the source and destination. Take a screenshot of your script and paste it in the lab report. Also paste a screenshot showing your folder created for your backup. Part 2 Linux Virtualization and Scripting For this part of the lab, we will be using the Linux operating system. If you do not have a Linux environment, you can set one up using VMWare using the steps below: 1. Install VMware workstation player on your computer. Download the install files and work through the wizard to install VMware. https://www.vmware.com/products/workstation- player/workstation-player-evaluation.html 2. Download the linux iso from the Files section of your course. It is named: ubuntu-18.04.1-desktop-amd64.iso This is a distribution of Linux named Ubuntu. Copy the file downloaded to a folder so you will remember where it is stored. I created a folder named Ubuntu and copied the file in there. Figure 2: Linux ISO 3. Next open VMWare and click the “Create a New Virtual
  • 6. Machine” Figure 3: New Virtual machine 4. Choose the Installer disk file and browse for the location of Ubuntu: Figure 4: Browse for disc file 5. Personalize Ubuntu with your name and password. IMPORTANT: write down your password so you will remember it Figure 5: Personalize Linux 6. Follow the rest of the defaults to install the Linux image. You may get this virtualization error: Figure 6: Virtualization error 7. If you get this virtualization error, you will need to go to the BIOS and enable virtualization. 8. Once Linux is installed explore the desktop Figure 7: Applications 9. Click on the 9 dots on the lower left corner to see all of the applications. Basic Script: We will be writing a script to create a directory and create a file within that directory. The file we will create will be the output of the ifconfig command. This command is similar to the ipconfig in Windows. We will direct the output of the ifconfig command into a new file using the file redirect >. First we must install the net-tools. Open the Terminal Window (it is one of the programs you see when you click on the 9 dots). Click on Terminal to open the terminal window At the terminal window type type the following command:
  • 7. sudo apt install net-tools When it is finished updating the net-tools you will see the prompt again: Next, we will write a script we will use the nano editor. At the Linux prompt, enter this command. nano create.sh Type in the following (please note the ls—l has two lowercase Ls): #This script named create.sh creates a directory and a file mkdir newDir echo “This is a script to create a directory” ls -l # “l” as in larry, “s” as in sam, then minus sign then “l” as in larry ifconfig > ./newDir/config.txt To save the file, press Control and O. Press enter to confirm the name. The ^ symbol in nano stands for the control key. Press Control and X to exit. To run a script type the following. ./create.sh However, you will receive a permission denied error. You will need to change permissions using the chmod command. Type in the following command. chmod 755 create.sh Now try to run the script with the following.
  • 8. ./create.sh Now that your script has run and created a file for you automatically, let's check the contents of that file. It is located in the newDir directory. Change directory to newDir and then use cat to view the contents of the config.txt file. The commands are below. cd newDir cat config.txt Take a screenshot of the script and the result of running the script. To view the script, you will need to move to the parent directory out of newDir. To do this, type this command. cd .. Then either open the editor again (nano create.sh) or type cat create.sh at the command prompt. Paste the screenshot of the script and the result of running the script in the lab report. Next, we will set up our linux VM as a web server. Instructions will also follow below. In order to set up the linux VM as a web server, it must be connected to the Internet. The first thing needed is the IP address of your linux machine. Type the command below. ifconfig Look at the inet addr. This is the IP address. In the screenshot above, the IP address is 192.168.93.128. Then you will need to update your Raspberry Pi and install Apache. Use the following commands. sudo apt-get update
  • 9. sudo apt-get install apache2 This will take several minutes to install, and you may need to type Y to accept the install. Next, go to a browser (on your linux VM – you will see Firefox in the upper left corner) and type in the IP address of the linux vm into the address bar. You should get a message that it works! http://192.168.93.128 Now let's modify the index.html page that you are viewing. Go back to the terminal window and navigate to the /var/www/html folder. Then type the ls command (lower case L) and you should see one file: index.html cd /var/www/html ls Now we will modify index.html. We will modify just a few lines but if you have experience with html or would like to learn and play with it, you are welcome to modify as much as you want! To edit the index.html file type in the following command to open the nano editor. sudo nano index.html This is the current code. Feel free to modify it. Change the title from “Apache 2 Ubuntu Default Page: It Works” to your name. Change what is between the <title> and </title>
  • 10. Save the file using ctrl + o. Then exit with ctrl + x. Open the web browser and type in the IP address of the pi into the address bar and you should see the new page. My page below has been changed quite a bit: Paste the screenshot of your site in the lab report showing the IP address. Deliverables Part 4 · Complete the Course Project Report · Include the pictures and descriptions required in the explanation above Part 5: Hardware and Software Presentation (due Week 8) · Create a Powerpoint Presentation with at least 10 slides. Include an Introduction, Challenges, Career Skills Learned, and a Conclusion slide · Create a video and or powerpoint presentation showing your project – all parts. An example video is here: https://lms.devry.edu/lms/video/player.html?video=1_xncbxdzb · Submit powerpoint and link to your video Part 4: Scripting and Virtualization (due Week 7)Objectives 1. To learn scripting on Windows and Linux 2. To add virtualization with a Linux distributionStepsPart 1— Windows Scripting Basic Script: Scripting is useful for small programming projects or quick tasks. Often, these programs are short and meant for small problems. Unlike compiled programming languages,
  • 11. scripting languages are generally interpreted. Batch files or scripts are created to automate tasks and may contain several commands in one file. Scripts can be created in Notepad. These are short files that run each command in sequence at file execution. The windows command-line interface can be used to run scripts. Below are some commands. Echo = Displays a message in the batch file Echo. displays a blank line @command turns off the display of the current command @echo off = does not echo back text cls = clears your screen :: = Adds comments to your code; this line will not be displayed Start = used to start a windows application Creating a Basic Script cls @echo off ::Your Name echo "Creating a data dump file" ipconfig /all > C:Scriptsconfig_info.txt echo end of script Open Notepad by going to Start-> All Programs -> Accessories- > Notepad. Type the above script into Notepad. Create a directory named Scripts on the C: drive. Save this file in the C:Scripts folder as myscript.cmd. Do not close your Notepad file. To run, open a command prompt by typing cmd in the Search Programs and Files box when you click the Start button or search for cmd.
  • 12. Change directory to the C:Scripts folder by typing the following. cd c:Scripts Then type in the following. myscript.cmd The script should run and will create a file. Use the dir command to see what files are created. Keep both the Notepad file and the command prompt open for the next step. You can also shut down a computer from a script. This is helpful for remote shutdown in a networking situation. Add the following commands to your script and save it in Notepad. (Note: The ping command, though normally used for networking, here waits 4 seconds.) shutdown /s /t 60 /c "Local shutdown in 1 minute!" ping -w 1000 0.0.0.0 > nul shutdown /a echo "Shutdown has been aborted" Click back to the command prompt. Type in myscript.cmd to run the script. You should see the script attempt to shut down, then abort the shutdown.
  • 13. Keep both your Notepad and command prompt open. Environment variables are built-in system variables available for all Windows processes describing users, paths, and so on. Some common environment variables are as follows. %PATH% = contains a list of directories with executable files, separated by semicolons. To add a path: SET PATH = %PATH%;C:WindowsEclipse %DATE% and %TIME% = current date and time %RANDOM% = returns a random number between 0 and 32767 %WINDIR% = points to the windows directory C:Windows %PATHEXT% = displays executable file extensions ie .com, .exe, .bat, .cmd, .vbs, .vbe, .js, .wsf, .wsh %USERNAME% = the current user Add the following commands to your script. echo "The date is " echo %DATE% echo "The path is " echo %PATH% Run your script in the command prompt. Now modify the script to display all the files in the directory (dir command) before the shutdown command and display two more environment variables. Take a screenshot of your script after running it and paste it in the lab report. Also paste your final script. The next script will be creating a backup script. In order to do this you will need to determine what files you want to back up, and the destination. You may want to back up school files, pictures, important documents, and so on. The files you will backup will need to be in a specific folder (i.e.,
  • 14. C:UsersSusieDocumentsFiles). Then you will need a separate place to back up your data. It could be a separate folder on your C: drive, or it could be an external drive or USB drive. You will also give your backup folder a custom name with the date. However, to do this you will need to strip out the / signs in the date. If you keep the / signs in the date, then when you create your backup folder there will be several subfolders. For example, see the date below: If we were to make a folder with the name backup_%date% it would have a confusing set of spaces and slashes: So we need to strip out the month, day, and year. We do this by extracting a position and number of characters. So this command: %date:~4,2% will start at the fourth character and extract two characters with the result of 07. To pull out the month, day, and year, use the following command. %date:~4,2%%date:~7,2%%date:~10,4% We will use this to create our backup folder name. Next, we will use the xcopy command to copy all files and subdirectories. The xcopy command works like this: xcopy source destination So if you want to copy files from your C:usersginaDocumentswork to your E:backup (E: is the USB drive in this case) you would use this command: xcopy C:usersginaDocumentswork* E:backup* /S /Y /I Note that switch S will copy all files and folders including subfolders, Y will overwrite files and not ask for confirmation, I will automatically create subfolders. Below is an example backup script. Replace Sheldon Cooper with your own name and replace the pathnames of the source and destination.
  • 15. Take a screenshot of your script and paste it in the lab report. Also paste a screenshot showing your folder created for your backup. Part 2 Linux Virtualization and Scripting For this part of the lab, we will be using the Linux operating system. If you do not have a Linux environment, you can set one up using VMWare using the steps below: 1. Install VMware workstation player on your computer. Download the install files and work through the wizard to install VMware. https://www.vmware.com/products/workstation- player/workstation-player-evaluation.html 2. Download the linux iso from the Files section of your course. It is named: ubuntu-18.04.1-desktop-amd64.iso This is a distribution of Linux named Ubuntu. Copy the file downloaded to a folder so you will remember where it is stored. I created a folder named Ubuntu and copied the file in there. Figure 2: Linux ISO 3. Next open VMWare and click the “Create a New Virtual Machine” Figure 3: New Virtual machine 4. Choose the Installer disk file and browse for the location of Ubuntu: Figure 4: Browse for disc file 5. Personalize Ubuntu with your name and password. IMPORTANT: write down your password so you will remember it
  • 16. Figure 5: Personalize Linux 6. Follow the rest of the defaults to install the Linux image. You may get this virtualization error: Figure 6: Virtualization error 7. If you get this virtualization error, you will need to go to the BIOS and enable virtualization. 8. Once Linux is installed explore the desktop Figure 7: Applications 9. Click on the 9 dots on the lower left corner to see all of the applications. Basic Script: We will be writing a script to create a directory and create a file within that directory. The file we will create will be the output of the ifconfig command. This command is similar to the ipconfig in Windows. We will direct the output of the ifconfig command into a new file using the file redirect >. First we must install the net-tools. Open the Terminal Window (it is one of the programs you see when you click on the 9 dots). Click on Terminal to open the terminal window At the terminal window type type the following command: sudo apt install net-tools When it is finished updating the net-tools you will see the prompt again: Next, we will write a script we will use the nano editor. At the Linux prompt, enter this command. nano create.sh
  • 17. Type in the following (please note the ls—l has two lowercase Ls): #This script named create.sh creates a directory and a file mkdir newDir echo “This is a script to create a directory” ls -l # “l” as in larry, “s” as in sam, then minus sign then “l” as in larry ifconfig > ./newDir/config.txt To save the file, press Control and O. Press enter to confirm the name. The ^ symbol in nano stands for the control key. Press Control and X to exit. To run a script type the following. ./create.sh However, you will receive a permission denied error. You will need to change permissions using the chmod command. Type in the following command. chmod 755 create.sh Now try to run the script with the following. ./create.sh Now that your script has run and created a file for you automatically, let's check the contents of that file. It is located in the newDir directory. Change directory to newDir and then use cat to view the contents of the config.txt file. The commands are below. cd newDir
  • 18. cat config.txt Take a screenshot of the script and the result of running the script. To view the script, you will need to move to the parent directory out of newDir. To do this, type this command. cd .. Then either open the editor again (nano create.sh) or type cat create.sh at the command prompt. Paste the screenshot of the script and the result of running the script in the lab report. Next, we will set up our linux VM as a web server. Instructions will also follow below. In order to set up the linux VM as a web server, it must be connected to the Internet. The first thing needed is the IP address of your linux machine. Type the command below. ifconfig Look at the inet addr. This is the IP address. In the screenshot above, the IP address is 192.168.93.128. Then you will need to update your Raspberry Pi and install Apache. Use the following commands. sudo apt-get update sudo apt-get install apache2 This will take several minutes to install, and you may need to type Y to accept the install. Next, go to a browser (on your linux VM – you will see Firefox in the upper left corner) and type in the IP address of the linux vm into the address bar. You should get a message that it works!
  • 19. http://192.168.93.128 Now let's modify the index.html page that you are viewing. Go back to the terminal window and navigate to the /var/www/html folder. Then type the ls command (lower case L) and you should see one file: index.html cd /var/www/html ls Now we will modify index.html. We will modify just a few lines but if you have experience with html or would like to learn and play with it, you are welcome to modify as much as you want! To edit the index.html file type in the following command to open the nano editor. sudo nano index.html This is the current code. Feel free to modify it. Change the title from “Apache 2 Ubuntu Default Page: It Works” to your name. Change what is between the <title> and </title> Save the file using ctrl + o. Then exit with ctrl + x. Open the web browser and type in the IP address of the pi into the address bar and you should see the new page. My page below has been changed quite a bit: Paste the screenshot of your site in the lab report showing the IP address. Deliverables Part 4
  • 20. · Complete the Course Project Report · Include the pictures and descriptions required in the explanation above Part 5: Hardware and Software Presentation (due Week 8) · Create a Powerpoint Presentation with at least 10 slides. Include an Introduction, Challenges, Career Skills Learned, and a Conclusion slide · Create a video and or powerpoint presentation showing your project – all parts. An example video is here: https://lms.devry.edu/lms/video/player.html?video=1_xncbxdzb · Submit powerpoint and link to your video CIS206 Course Project Report TCO 5: Given a business requirement requiring the writing of a script or a command file, develop a script or command program that meets the specified business requirement for administrators or programmers. The instructions for this project are located in the Course Home. Rubric Point Distribution for This Project Project activities Document Points Possible Points Received Part 1: Windows Basic Script 15
  • 21. Part 2: Windows Backup Script 20 Part 3: Linux Basic Script 15 Part 4: Linux Web Server 20 Total Points 70 1—Windows Script: Basic Script Script screenshot:
  • 22. After running script screenshot: 2—Windows Script: Backup Script Script screenshot: Folder showing backup screenshot: 3—Linux Script: Basic Script Script screenshot:
  • 23. After running script screenshot: 4—Linux Script: Web Server Screenshot of the site showing the IP address: