Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab No.4: Shell Expansion For this lab you are going to use an archive that is located at : lab04.tar.gz Use the following command to

Lab No.4: Shell Expansion

For this lab you are going to use an archive that is located at : lab04.tar.gz Use the following command to download it to your home directory:

[user@blue ~]$ wget https://jcabmora.github.io/cs210sp20/_downloads/lab04.tar.gz -O ~/lab04.tar.gz
[user@blue ~]$ if [[ -d lab04 ]]; then echo "Directory lab04 already exists, please remove or rename it"; else tar -xvzf lab04.tar.gz; fi
[user@blue ~]$ cd lab04/logs [user@blue logs]$ ls afpd.log dnf.log-20200126 maillog openvpnas.log test boot.log dnf.log-20200202 maillog-20200126 openvpnas.log.1 vbox-setup.log btmp dnf.log-20200209 maillog-20200202 README vbox-setup.log.01 btmp-20200201 dnf.log-20200216 maillog-20200209 secure vbox-setup.log.02 cron dnf.rpm.log maillog-20200216 secure-20191202 vbox-setup.log.03 cron-20200102 dnf.rpm.log-20200126 mediawiki-updates.log secure-20200102 vbox-setup.log.04 cron-20200108 dnf.rpm.log-20200202 messages secure-20200115 vbox-setup.log.4 cron-20200111 dnf.rpm.log-20200209 messages-20190902 secure-20200125 vmware-vmusr.log cron-20200126 dnf.rpm.log-20200216 messages-20191202 secure-20200126 wtmp cron-20200202 dpkg.log messages-20200102 secure-20200202 wtmp-20200201 cron-20200209 firewalld messages-20200108 secure-20200209 xferlog cron-20200216 grubby messages-20200109 secure-20200216 xferlog-20200126 dnf hawkey.log messages-20200112 sendmail.log xferlog-20200202 dnf.librepo.log hawkey.log-20200126 messages-20200121 spooler xferlog-20200209 dnf.librepo.log-20200126 hawkey.log-20200202 messages-20200125 spooler-20200126 xferlog-20200216 dnf.librepo.log-20200202 hawkey.log-20200209 messages-20200126 spooler-20200202 Xorg.0.log dnf.librepo.log-20200209 hawkey.log-20200216 messages-20200202 spooler-20200209 Xorg.0.log.old dnf.librepo.log-20200216 kern messages-20200209 spooler-20200216 Xorg.1.log dnf.log lastlog messages-20200216 tallylog Xorg.1.log.old
[user@blue logs]$ ls -1 | wc 95 95 1428
[user@blue logs]$ ls dnf* dnf dnf.librepo.log-20200209 dnf.log-20200202 dnf.rpm.log-20200126 dnf.librepo.log dnf.librepo.log-20200216 dnf.log-20200209 dnf.rpm.log-20200202 dnf.librepo.log-20200126 dnf.log dnf.log-20200216 dnf.rpm.log-20200209 dnf.librepo.log-20200202 dnf.log-20200126 dnf.rpm.log dnf.rpm.log-20200216
[user@blue logs]$ ls *20200202 cron-20200202 dnf.log-20200202 hawkey.log-20200202 messages-20200202 spooler-20200202 dnf.librepo.log-20200202 dnf.rpm.log-20200202 maillog-20200202 secure-20200202 xferlog-20200202
[user@blue logs]$ ls *02 cron-20200102 dnf.log-20200202 maillog-20200202 messages-20200102 secure-20200102 vbox-setup.log.02 cron-20200202 dnf.rpm.log-20200202 messages-20190902 messages-20200202 secure-20200202 xferlog-20200202 dnf.librepo.log-20200202 hawkey.log-20200202 messages-20191202 secure-20191202 spooler-20200202
[user@blue logs]$ ls *20????02 cron-20200102 dnf.log-20200202 maillog-20200202 messages-20200102 secure-20200102 xferlog-20200202 cron-20200202 dnf.rpm.log-20200202 messages-20190902 messages-20200202 secure-20200202 dnf.librepo.log-20200202 hawkey.log-20200202 messages-20191202 secure-20191202 spooler-20200202
[user@blue logs]$ ls *2020010? cron-20200102 cron-20200108 messages-20200102 messages-20200108 messages-20200109 secure-20200102
[user@blue logs]$ ls *2020010[3456789] cron-20200108 messages-20200108 messages-20200109
[user@blue logs]$ ls *2020010[3-9] cron-20200108 messages-20200108 messages-20200109

Part 1

For this part of the lab, you will use the files that are located in the lab04/dataset directory. The files contained in this directory simulate a dataset where each file is associated with a single benchmark job. Each job can have two types of files associated with it:

  • .dat are data files. Every job always has one of these.
  • .err are error files and they are only present if there was an error during the job execution.

The file names in this directory follow certain semantics. A typical file in the dataset directory will look like this: andromeda_8cores_min-20170125.err. The file name is comprised of several elements:

  • The first part of the file (before the first underscore, andromeda in the example), corresponds to the machine where the benchmark was run. Other values are chronos, leo, ursaminor, ursamajor.
  • The second part (before the second underscore) indicates the number of cores used during the benchmark execution. Options are 8cores,4cores,2cores and 1core
  • The part between the second underscore and the hyphen, corresponds to the benchmark code. The available options are fft1d, fft2d, max and min.
  • The element after the hyphen and before the file extension, correspond to the job timestamp in the format YYYYMMDD.
  • The last element (The one after the period) corresponds to the extension (.dat or .err)

Provide commands whose output will answer the following questions:

  1. How many job executions are included the dataset?
  2. How many job executions used less than 4 cores?
  3. How many job executions of the fft1d and fft2d benchmarks were completed in a February?
  4. How many data files were generated in leo and chronos in 2017 in the first half of the month (before the fifteen day of the month)?

Part 2

  1. Write a command that will create all the following files (within your current working directory). Each file corresponds to a year-month combination (from January 2010 until December 2012)
[user@blue test]$ ls 2010-01 2010-04 2010-07 2010-10 2011-01 2011-04 2011-07 2011-10 2012-01 2012-04 2012-07 2012-10 2010-02 2010-05 2010-08 2010-11 2011-02 2011-05 2011-08 2011-11 2012-02 2012-05 2012-08 2012-11 2010-03 2010-06 2010-09 2010-12 2011-03 2011-06 2011-09 2011-12 2012-03 2012-06 2012-09 2012-12

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions