Question

In: Computer Science

1) In no less than 100 words, describe a situation where you would want to kill...


1) In no less than 100 words, describe a situation where you would want to kill a process?
2) Give an example of when the pstree command would be helpful.
3) Provide an example of when you would want to run a process as a background process.
4) Which NICE priority is the fastest priority? Which is exactly in the middle?
5) Discuss a command that an administrator would want to schedule on Friday of every week. Give an example of the command.
6) Describe the difference between the "at" and "cron" commands. What is an equivalent application in MS Windows?
7) Provide a CRON entry for scheduling the script /root/testscript to run every Thursday at 11:05 AM.

Solutions

Expert Solution

1 .Kill Process:

When a process misbehaves, you might sometimes want to terminate or kill it

.Each process you start is usually completed within a few seconds. Sometimes a background process or a process without a controlling terminal hangs up and you will need to destroy this process by killing it.

Infinite Loop:

An infinite loop is a looping construct that does not terminate the loop and executes the loop forever.

for(; ;)  

{      // body of the for loop

.  }  

If you are executing it, and that too on linux terminal, then Ctrl+Z or Ctrl+C work fine. It would kill/stop the process and you can make your changes accordingly.

2) Give an example of when the pstree command would be helpful.

Since every process (except the very first one) in a Linux system has a parent, it sometimes makes things easier to understand if all processes are displayed in a tree structure. You'll be glad to know there exists a command line utility - dubbed pstree - that displays a tree of processes.

pstree is a Linux command that shows the running processes as a tree.

It is used as a more visual alternative to the ps command. The root of the tree is either init or the process with the given pid.
pstree visually merges identical branches by putting them in square brackets and prefixing them with the repetition count.

Example

To see a tree diagram of all the processes currently on the server, type:

# pstree
# pstree | less
# pstree | more

At the top of the diagram, you will the process init which is the first process that is started when Linux comes on line. init is the parent of all processes on the system, it is executed by the kernel and is responsible for starting all other processes. You can use ASCII characters to draw the tree by passing the -A option:
# pstree -A

3) Provide an example of when you would want to run a process as a background process.

To run a program in the background, enter the command for that job, followed by the & sign.

This returns the Unix prompt to you and executes the job while still allowing you to interact with your terminal. Jobs may be switched from foreground to background and vice versa.

When you run a job in the background, the shell will respond with a number. This number is the "process identification number", or PID. It is useful if you want to halt, or `kill' the program.

example Garbage Collection:

Garbage Collection is removes the unused objects from the memory .It is run as the Background Process .It provides the services to background supportive tasks .

It Act as Deamon threads if all services stop their working background process automatically stop working.

4) Which NICE priority is the fastest priority? Which is exactly in the middle?

nice is a program found on Unix and Unix-like operating systems such as Linux.

It directly maps to a kernel call of the same name.

nice is used to invoke a utility or shell script with a particular CPU priority, thus giving the process more or less CPU time than other processes.

The Nice priorty 0 is the fastest priority the range of NICE priority is -20t0 +20 the middle which is exactly in middle.

5) Discuss a command that an administrator would want to schedule on Friday of every week. Give an example of the command.

You can use the at command to schedule a command, a script, or a program to run at a specified date and time. You can also use this command to view existing scheduled tasks.

To use the at command, the Task Scheduler service must be running, and you must be logged on as a member of the local Administrators group.

When you use the at command to create tasks, you must configure the tasks so that they run in the same user account.

The at command uses the following syntax:

  • at \\computername time/interactive | /every: date, ... /next: date, ... command

  • at \\computername id/delete | /delete /yes

  The following list describes the parameters that you can use with the at command:

  \computername: Use this parameter to specify a remote computer. If you omit this parameter, tasks are scheduled to run on the local computer.

  • time: Use this parameter to specify the time when the task is to run. Time is specified as hours: minutes based on the 24-hour clock. For example, 0:00 represents midnight and 20:30 represents 8:30 P.M.

  • /interactive: Use this parameter to allow the task to interact with the desktop of the user who is logged on at the time the task runs.

  • /every: date,... : Use this parameter to schedule the task to run on the specified day or days of the week or month, for example, Friday of every week Specify date as one or more days of the week (use the following abbreviations: M,T,W,Th,F,S,Su) or one or more days of the week(use the numbers 1 through 7). Make sure that you use commas to separate multiple date entries. If you omit this parameter, the task is scheduled to run on the current day.

Examples of at command:

1.Schedule a job for the coming Monday at a time twenty minutes later than the current time:

at Monday +20 minutes

2. Schedule a job to run at 1:45 Aug 12 2020:

at 1:45 081220

6) Describe the difference between the "at" and "cron" commands. What is an equivalent application in MS Windows?
at command:

At is the one-shot At a certain time (tommarrow at 14:00 AM)job is started Once At schedule the task at only once

Schedule a job for the coming Monday at a time twenty minutes later than the current time:

at Monday +20 minutes

.cron command:

CRON command running the task in regular base.(every hour,day,first of the month)

cron job is used to maintain the daily routing work.

cron is used in ETL project in UNIX Envoirment to schedule recurring jobs as per desired time mode without tedious in nature.

The windows equivalent to a cron job is a scheduled task.

With Scheduled Tasks, you can schedule any script, program, or document to run at a time that is most convenient for you. Scheduled Tasks starts every time that you start Windows XP and runs in the background, and it starts each task that you schedule at the time that you specify when you create the task


Related Solutions

In less than 100 words to describe the impact of Information Technology to the business operation...
In less than 100 words to describe the impact of Information Technology to the business operation of a company.
Discuss the below in no less than 100 words. a) Describe why RAID is an important...
Discuss the below in no less than 100 words. a) Describe why RAID is an important consideration for your Linux server. b) What version of a RAID would you use for a medium-size business? Support your answer with reasons for the choice. Provide the number of disks you will need to optimize your choice. c) Additionally, indicate whether you would use iSCSI or locally attached drives for this configuration. Support your answers.
a) In no less than 100 words, describe several ways that an administrator could use the...
a) In no less than 100 words, describe several ways that an administrator could use the alias command to make their job easier. b )In no less than 100 words, describe how you could use the "if" construct in administrating a Linux system. c) Describe what stdout is? What is the default stdin? Describe stderr. d) What file descriptor number represents stdout? e) Describe redirection in BASH. Provide a command that uses redirection.
1)Develop your definition of counseling 2)Describe in less than 100 words what ideas,concept and issues you...
1)Develop your definition of counseling 2)Describe in less than 100 words what ideas,concept and issues you have learned
in the movie " A Time to Kill", describe the situation that you analyze and interpret...
in the movie " A Time to Kill", describe the situation that you analyze and interpret the actions of the characters depicting social psychology in the courtroom. Draw conclusion based on social psychological Concepts and theories. you will analyze a 3 to 5 minutes segment of a movie or television episode depicting social psychology in the courtroom. after watching the movie segments create a 3-to-4 page report on your analysis. in your report mentioned the name of the movie, describe...
Q5: When the issue is less than their receipts this will lead to a situation where:
Q5: When the issue is less than their receipts this will lead to a situation where:Select one:a. More Inventoryb. None of the abovec. Shortage of Inventoryd. Zero InventoryQ6: The items which are discarded from a production process are known as:Select one:a. Inventoryb. Repaired itemsc. Rejected itemsd. Spare partsQ7: The items required to produce a product or deliver a service is known as:Select one:a. Rejected itemsb. Repaired itemsc. Spare partsd. Inventory
Describe a situation where you would use ANOVA by stating 1. the quantity of populations that...
Describe a situation where you would use ANOVA by stating 1. the quantity of populations that are to be investigated, 2 a quantitative variable on these populations, 3 the sizes of samples from these populations, 4 your null hypothesis, 5 your alternative hypothesis, and 6 a significance level. Then find 7 the degree of freedom of the numerator of your F- statistic, 8 the degree of freedom of the denominator of your F- statistic, and state 9 what the P-...
Describe a situation where you would use ANOVA by stating 1. the quantity of populations that...
Describe a situation where you would use ANOVA by stating 1. the quantity of populations that are to be investigated, 2. a quantitative variable on these populations, 3. the sizes of samples from these populations, 4. your null hypothesis, 5. your alternative hypothesis, and 6. a significance level. Then find 7. The degrees of freedom of the numerator of your F-statistic, 8. the degrees of freedom of the denominator of your F-statistic, and state 9. what the P-value for your...
In no less than 100 words, as you complete your assignment, consider some of the similarities...
In no less than 100 words, as you complete your assignment, consider some of the similarities and differences between using a manual system versus a computerized system. Hint: Refer to Chapter 6 pages 170 & 171 for discussion of computerized accounting systems.
1) When the percent recovery is less than 100%, where is most of the uncovered material...
1) When the percent recovery is less than 100%, where is most of the uncovered material and how might you go about recovering it if you needed to? (three of fewer sentences) 2) Hot filtration was not necessary in the recrystallization of phthalic acid but was necessary in the recrystallization of naphthalene. Why was it necessary in the recrystallization of naphthalene? Both of these are about a recrystallization experiment.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT