Question

In: Computer Science

Need to process these steps in UNIX. To encourage users to get a good night's sleep,...

Need to process these steps in UNIX.

To encourage users to get a good night's sleep, it has been decided that the web server will be unavailable from 23:30 each night until 07:00 the next morning.

Create a cron file named /etc/cron.d/web that stops httpd each evening at 23:30 and restarts it the next morning at 07:00.

Solutions

Expert Solution

Run the following command to create the file:

touch /etc/cron.d/web

Code to be written in this file:

#define the shell which will be used to run the commands
SHELL=/bin/bash
#defines the path of shell
PATH=/sbin:/bin:/usr/sbin:/usr/bin
#if you want to send the mail to user, set this property
MAILTO=""
#cronjob to stop the web server each night at 23:30
30 23 * * * root systemctl stop httpd
#cronjob to start the web server each morning at 07:00
00 07 * * * root systemctl start httpd

The first 5 parameters of the cron job are used to define the time when the cronjob would be run.

1st is for the minutes. 2nd is for the hours. 3rd is for the day of the month. 4th is for the month. 5th is for the day of the week. These must be followed by the command which needs to be run.

As we want our cronjob to run each day, we set the last three parameters as * which means for all the values of that parameter. For the first two, we define the minutes and hours.

Also, to stop or start the httpd service we require administrator access so we specify the keyword root before writing those commands to provide root access while running the job.


Related Solutions

Students who get more sleep get better grades. You want to estimate the hours of sleep...
Students who get more sleep get better grades. You want to estimate the hours of sleep per night that a college student gets. You select 29 students; on average they slept 6.2 hours with a standard deviation of 1.8 hours. The standard error is 0.334. In order to be 90% confident of an estimate of the population mean, what is the margin of error? (Enter the value with three decimal places, using form #.###)
How sleep works? and why people need to sleep ?
How sleep works? and why people need to sleep ?
There are four steps that need to be taken to process a business's financial transactions.
There are four steps that need to be taken to process a business's financial transactions. The first is to identify all of the financial transactions that a company has made within a specific time frame, usually monthly. The second step is to analyze each transaction individually. The next step is record these transactions onto a financial journal by date. The final step is to transfer these figures onto a company ledger.. It is very important that you record all of...
2. Good sleep or bad sleep? ~ A study was conducted to identify the factors affecting...
2. Good sleep or bad sleep? ~ A study was conducted to identify the factors affecting quality of sleep for university students. A survey of 290 students of different majors aged 17-29 years old revealed that 67.2% of these students suffered from poor sleep. a. Create a 95% confidence interval for the = the population proportion of university students aged 17-29 years old who suffer from poor sleep. Final answer: ( ______________________ , _____________________ ) b. Determine whether each of...
There are several steps need to be considered to fulfill the structural design process. Describe the...
There are several steps need to be considered to fulfill the structural design process. Describe the design process which involves building form and structural arrangement.
This is unix based server management Part A Steps in the exercise: Write, and verify the...
This is unix based server management Part A Steps in the exercise: Write, and verify the operation of, an rsync command that will perform a differential backup in place of the copy command. Verify that the rsync process is backing up only the incremental files by running it, then running it again, then adding a new file, and running again. Include the option in rsync to delete any files that do not exist in the destination directory. Verify this by...
What are the UNIX commands for each of these steps? 1. Copy all of the files...
What are the UNIX commands for each of these steps? 1. Copy all of the files in your Files directory to the Backup directory. 2. Create an ITE130 directory in the Classes Directory 3. Move all the ITE 130 files from the backup directory to the ITE130 directory. 4. Redirect echo step 19 to mark this step in the lab3.txt file 5. Display all of the directories and sub-directories including files so I can verify you completed all the above...
What are the UNIX commands for each of these steps? 1. Delete all the files in...
What are the UNIX commands for each of these steps? 1. Delete all the files in the Classes and Backup directories only. 2. Redirect echo step 23 to mark this step in the lab3.txt file 3. Display all of the directories and sub-directories including files so I can verify you completed all the steps correctly. 4. Repeat the above step and redirect the output to the file lab3.txt without erasing what is already in it! 5. Redirect echo step 26...
Which of the following government policies will encourage the consumption of a good?
Which of the following government policies will encourage the consumption of a good?Group of answer choices:Price ceilingExcise tax to buyersSubsidy to buyersPrice regulation
A researcher is interested in whether college students get enough sleep. She suspects that they get...
A researcher is interested in whether college students get enough sleep. She suspects that they get less than 8 hours of sleep on average. The sample mean (x ̄) for 65 students was 7.08 hours. The standard deviation of number of hours students slept is s=1.8. (a) Determine the null and alternative hypothesis for the test. What is the parameter in this study? (b) The p-value for the test is <0.0001. Using a significance level of .05, write a one...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT