Skip to content

Commit cff359d

Browse files
authored
First pass terminology reviews: (#1144)
* Each document was reviewed for inclusive, gender neutral, and other "possible" offensive terms using vale and the alex, Red Hat and vale built in dictionaries. * there is more to do in each of these documents but they have been improved.
1 parent 287a15d commit cff359d

File tree

6 files changed

+103
-105
lines changed

6 files changed

+103
-105
lines changed

docs/guides/automation/anacron.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ update : 2021-10-20
99

1010
## Prerequisites
1111

12-
* A machine running Rocky Linux.
13-
* Know how to use your favorite editor to modify the configuration file (such as *vim*) in the command line environment.
12+
* A computer running Rocky Linux.
13+
* Know how to use your favorite editor to change the configuration file (such as *vim*) in the command line environment.
1414
* Understand basic RPM package management.
1515

1616
## Assumptions
1717

18-
* You have understood the basic knowledge of bash, python or other scripting/programming tools, and want to run the script automatically.
19-
* You are logged in as the root user, or switch to root with `su - root`.
18+
* You have understood the basic knowledge of bash, python or other scripting or programming tools, and want to run the script automatically.
19+
* You connected in as the root user, or switch to root with `su - root`.
2020

2121
## `anacron` Introduction
2222

23-
**`anacron` is used to run commands on a regular basis, and the operating frequency is defined in units of days. It is suitable for computers that do not run 24/7, such as laptops and desktops. Suppose you have a scheduled task (such as a backup script) to be run in the early morning of every day using crontab. When you fall asleep, your desktop/laptop is shut down. Your backup script will not be executed. However, if you use `anacron`, you can rest assured that the next time you turn on the desktop/laptop, the backup script will be executed.**
23+
**`anacron` runs commands on a regular basis, and the operating frequency is defined in units of days. It is suitable for computers that do not run 24/7, such as laptops and desktops. Suppose you have a scheduled task (such as a backup script) to be run in the early morning of every day using crontab. When you fall asleep, your desktop or notebook is off. Your backup script will not run. However, if you use `anacron`, you can rest assured that the next time you turn on the desktop or notebook, the backup script will run.**
2424

2525
The appearance of `anacron` is not to replace `crontab`, but to complement `crontab`. Their relationship is as follows:
2626

@@ -93,24 +93,24 @@ For more configuration file information, please [Browse the manual page](https:/
9393

9494
## User use
9595

96-
In order to make certain files run within these automatically defined times, all you need to do is to copy the script file to the relevant directory and make sure that it has ** x execution permission (chmod +x) ** . Therefore, you only need to let the system automatically run the script at one of these scheduled times, which makes the automation task very easy.
96+
To make certain files run within these automatically defined times, all you need to do is to copy the script file to the relevant directory and verify that it has ** x execution permission (chmod +x) ** . Therefore, you only need to let the system automatically run the script at one of these scheduled times, which simplifies the automation task.
9797

98-
Let's use cron.daily to illustrate the execution process of /etc/anacrontab:
98+
Let us use cron.daily to illustrate the run process of /etc/anacrontab:
9999

100-
1. `anacron` reads the ** /var/spool/anacron/cron.daily ** file, and the content of the file shows the time of the last execution.
101-
2. Compared with the current time, if the difference between the two times exceeds 1 day, the cron.daily job will be executed.
102-
3. This work can only be performed from 03:00-22:00.
103-
4. Check whether a file is executed after 5 minutes after booting. When the first one is executed, it will be randomly delayed for 0~45 minutes to execute the next one.
104-
5. Use the nice parameter to specify the default priority, and use the run-parts parameter to execute all executable files in the /etc/cron.daily/ directory.
100+
1. `anacron` reads the ** /var/spool/anacron/cron.daily ** file, and the content of the file shows the time of the last run.
101+
2. Compared with the current time, if the difference between the two times exceeds 1 day, the cron.daily job will run.
102+
3. This work can only run from 03:00-22:00.
103+
4. Verify whether a file runs after 5 minutes after booting. When the first one runs, it will be randomly delayed for 0~45 minutes to run the next one.
104+
5. Use the nice parameter to specify the default priority, and use the run-parts parameter to run all executable files in the /etc/cron.daily/ directory.
105105

106106
## Related Commands
107107

108108
Use the command `anacron`, commonly used options are:
109109

110110
| Options | Description |
111111
| --- | --- |
112-
| -f | Execute all jobs, ignoring timestamps |
112+
| -f | Run all jobs, ignoring timestamps |
113113
| -u | Update the timestamp to the current time without performing any action |
114114
| -T | Test the validity of the configuration file /etc/anacrontab |
115115

116-
For more help information, please [Browse the manual page](https://man7.org/linux/man-pages/man8/anacron.8.html)
116+
For more help information, [browse the manual page](https://man7.org/linux/man-pages/man8/anacron.8.html)

docs/guides/automation/cron_jobs_howto.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,30 @@ tags:
1313

1414
## Prerequisites
1515

16-
* A machine running Rocky Linux
17-
* Some comfort with modifying configuration files from the command-line using your favorite editor (`vi` is used here)
16+
* A computer running Rocky Linux
17+
* Some comfort with modifying configuration files from the command-line by using your favorite editor (using `vi` here)
1818

1919
## <a name="assumptions"></a> Assumptions
2020

21-
* Basic knowledge of bash, python, or other scripting/programming tools, and the desire to have a script run automatically
21+
* Basic knowledge of bash, python, or other scripting or programming tools, and you want to have a script run automatically
2222
* That you are either running as the root user or have switched to root with `sudo -s`
2323
**(You can run certain scripts in your own directories as your own user. In this case, switching to root is not necessary.)**
24-
* We assume that you're pretty cool.
2524

2625
## Introduction
2726

28-
Linux provides the _cron_ system, a time-based job scheduler, for automating processes. It's simple and yet quite powerful. Want a script or program to run every day at 5 PM? This is where you set that up.
27+
Linux provides the _cron_ system, a time-based job scheduler, for automating processes. It is simplistic and yet quite powerful. Want a script or program to run every day at 5 PM? This is where you set that up.
2928

30-
The _crontab_ is essentially a list where users add their own automated tasks and jobs, and it has a number of options that can simplify things even further. This document will explore some of these. It's a good refresher for those with some experience, and new users can add the `cron` system to their repertoire.
29+
The _crontab_ is essentially a list where users add their own automated tasks and jobs, and it has many options that can simplify things even further. This document will explore some of these. It is a good refresher for those with some experience, and new users can add the `cron` system to their repertoire.
3130

32-
`anacron` is discussed briefly here in reference to the `cron` "dot" directories. `anacron` is run by `cron`, and is advantageous for machines that are not up all the time, such as workstations and laptops. The reason for this is that while `cron` runs jobs on a schedule, if the machine is off when the job is scheduled, the job does not run. With `anacron` the job is picked up and run when the machine is on again, even if the scheduled run was in the past. `anacron` though, uses a more randomized approach to running tasks where the timing is not exact. This makes sense for workstations and laptops, but not so much for servers. This can be a problem for things like server backups, for instance, that need to run at a specific time. That's where `cron` continues to provide the best solution for server administrators. All that being said, server administrators and workstation or laptop users can gain something from both approaches. You can easily mix and match based on your needs. For more information on `anacron` see [anacron - Automating commands](anacron.md).
31+
`anacron` is discussed briefly here in reference to the `cron` "dot" directories. `anacron` is run by `cron`, and is helpful for machines that are not up all the time, such as workstations and laptops. The reason for this is that while `cron` runs jobs on a schedule, if the machine is off when the job is scheduled, the job does not run. With `anacron` the job is picked up and run when the machine is on again, even if the scheduled run was in the past. `anacron` though, uses a more randomized approach to running tasks where the timing is not exact. This makes sense for workstations and laptops, but not so much for servers. This can be a problem for things such as server backups, for instance, needing to run a job at a specific time. That is where `cron` provides the best solution for server administrators. Still, server administrators and workstation or notebook users can gain something from both approaches. You can mix and match based on your needs. For more on `anacron` see [anacron - Automating commands](anacron.md).
3332

3433
### <a name="starting-easy"></a>Starting Easy - The `cron` Dot Directories
3534

36-
Built into every Linux system for many versions now, the `cron` "dot" directories help to automate processes quickly. These show up as directories that the `cron` system calls based on their naming conventions. They are called differently, however, based on which process is assigned to call them, `anacron` or `cron`. The default behavior is to use `anacron`, but this can be changed by a server, workstation or laptop administrator.
35+
Built into every Linux system for many versions now, the `cron` "dot" directories help to automate processes quickly. These show up as directories that the `cron` system calls based on their naming conventions. They are run differently, however, based on the process assigned to call them, `anacron` or `cron`. The default behavior is to use `anacron`, but this can be changed by a server, workstation or notebook administrator.
3736

3837
#### <a name="for_servers"></a>For Servers
3938

40-
As stated in the introduction, `cron` normally runs `anacron` these days to execute scripts in these "dot" directories. You *may*, though, want to use these "dot" directories on servers as well, and if that is the case, then there are two steps that you can take to make sure that these "dot" directories are run on a strict schedule. To do so, we need to install a package and remove another one:
39+
As stated in the introduction, `cron` normally runs `anacron` these days to run scripts in these "dot" directories. You *may*, want to use these "dot" directories on servers as well, and if that is the case, there are two steps that you can take to verify that these "dot" directories run on a strict schedule. To do this, you need to install a package and remove another one:
4140

4241
`dnf install cronie-noanacron`
4342

@@ -67,7 +66,7 @@ This translates to the following:
6766

6867
#### <a name="for_workstations"></a>For Workstations
6968

70-
If you want to run scripts on a workstation or laptop in the `cron` "dot" directories, then there is nothing special that you need to do. Simply copy your script file into the directory in question, and make sure it is executable. Here are the directories:
69+
If you want to run scripts on a workstation or notebook in the `cron` "dot" directories, nothing special is needed. Just copy your script file into the directory in question, and make sure it is executable. Here are the directories:
7170

7271
* `/etc/cron.hourly` - Scripts placed here will run one minute past the hour every hour. (this is run by `cron` regardless of whether `anacron` is installed or not)
7372
* `/etc/cron.daily` - Scripts placed here will run every day. `anacron` adjusts the timing of these. (see tip)
@@ -78,15 +77,15 @@ If you want to run scripts on a workstation or laptop in the `cron` "dot" direct
7877

7978
These are likely to be run at similar (but not exactly the same) times every day, week, and month. For more exact running times, see the @options below.
8079

81-
So provided you're alright with just letting the system auto-run your scripts, and allowing them to run sometime during the specified period, then it makes it very easy to automate tasks.
80+
Provided you are good with just letting the system auto-run your scripts, and allowing them to run sometime during the specified time, it simplifies the automation of tasks.
8281

8382
!!! note
8483

8584
There is no rule that says a server administrator cannot use the randomized run times which `anacron` uses to run scripts in the "dot" directories. The use case for this would be for a script that is not time sensitive.
8685

8786
### Create Your Own `cron`
8887

89-
Of course, if the automated, randomized times don't work well in [For Workstations above](#for-workstations), and the scheduled times in the [For Servers above](#for-servers), then you can create your own. In this example, we are assuming you are doing this as root. [see Assumptions](#assumptions) To do this, type the following:
88+
If the automated, randomized times do not work well in [For Workstations above](#for-workstations), and the scheduled times in the [For Servers above](#for-servers), then you can create your own. In this example, we are assuming you are doing this as root. [see Assumptions](#assumptions) To do this, type the following:
9089

9190
`crontab -e`
9291

@@ -118,19 +117,19 @@ This will pull up root user's `crontab` as it exists at this moment in your chos
118117
# m h dom mon dow command
119118
```
120119

121-
Notice that this particular `crontab` file has some of its own documentation built-in. That isn't always the case. When modifying a `crontab` on a container or minimalist operating system, the `crontab` will be an empty file unless an entry has already been placed in it.
120+
Notice that this particular `crontab` file has some of its own documentation built-in. That is not always the case. When modifying a `crontab` on a container or minimalist operating system, the `crontab` will be an empty file unless an entry is in it.
122121

123-
Let's assume that we have a backup script that we want to run at 10 PM at night. The `crontab` uses a 24 hour clock, so this would be 22:00. Let's assume that the backup script is called "backup" and that it is currently in the _/usr/local/sbin_ directory.
122+
Assume that you have a backup script that you want to run at 10 PM at night. The `crontab` uses a 24 hour clock, this would be 22:00. Assume that the backup script is called "backup" and that it is currently in the _/usr/local/sbin_ directory.
124123

125124
!!! note
126125

127126
Remember that this script needs to also be executable (`chmod +x`) in order for the `cron` to run it.
128127

129-
To add the job, we would:
128+
To add the job, you:
130129

131130
`crontab -e`
132131

133-
`crontab` stands for "cron table" and the format of the file is, in fact, a loose table layout. Now that we are in the `crontab`, go to the bottom of the file and add your new entry. If you are using `vi` as your default system editor, then this is done with the following keys:
132+
`crontab` stands for "cron table" and the format of the file is, in fact, a loose table layout. Now that you are in the `crontab`, go to the bottom of the file and add your new entry. If you are using `vi` as your default system editor, then this is done with the following keys:
134133

135134
`Shift : $`
136135

@@ -144,11 +143,11 @@ To run our backup script every day at 10:00, the entry would look like this:
144143

145144
`00 22 * * * /usr/local/sbin/backup`
146145

147-
This says run the script at 10 PM, every day of the month, every month, and every day of the week. Obviously, this is a pretty simple example and things can get quite complicated when you need specifics.
146+
This says run the script at 10 PM, every day of the month, every month, and every day of the week. This is a simplistic example and things can get quite complicated when you need specifics.
148147

149148
### The @options for `crontab`
150149

151-
Another way to run jobs at a strictly scheduled time (i.e., day, week, month, year, etc.) is to use the @options, which offer the ability to use more natural timing. The @options consist of:
150+
Another way to run jobs at a strictly scheduled time (i.e., day, week, month, year, and so on.) is to use the @options, which offer the ability to use more natural timing. The @options consist of:
152151

153152
* `@hourly` runs the script every hour of every day at 0 minutes past the hour. (this is exactly the result of placing your script in `/etc/cron.hourly` too)
154153
* `@daily` runs the script every day at midnight.
@@ -167,27 +166,27 @@ For our backup script example, if we use the @daily option to run the backup scr
167166

168167
### More Complex Options
169168

170-
So far, everything we have talked about has had pretty simple options, but what about the more complex task timings? Let's say that you want to run your backup script every 10 minutes during the day (probably not a very practical thing to do, but hey, this is an example!). To do this you would write:
169+
So far, everything we have talked about has had pretty simplistic options, but what about the more complex task timings? Say that you want to run your backup script every 10 minutes during the day (probably not a practical thing to do, but hey, this is an example!). To do this you would write:
171170

172171
`*/10 * * * * /usr/local/sbin/backup`
173172

174-
What if you wanted to run the backup every 10 minutes, but only on Monday, Wednesday and Friday?:
173+
What if you wanted to run the backup every 10 minutes, but only on Monday, Wednesday, and Friday?:
175174

176175
`*/10 * * * 1,3,5 /usr/local/sbin/backup`
177176

178177
What about every 10 minutes every day except Saturday and Sunday?:
179178

180179
`*/10 * * * 1-5 /usr/local/sbin/backup`
181180

182-
In the table, the commas let you specify individual entries within a field, while the dash lets you specify a range of values within a field. This can happen in any of the fields, and on multiple fields at the same time. As you can see, things can get pretty complicated.
181+
In the table, the commas lets you specify individual entries within a field, and the dash lets you specify a range of values within a field. This can happen in any of the fields, and on many fields at the same time. As you can see, things can get pretty complicated.
183182

184183
When determining when to run a script, you need to take time and plan it out, particularly if the criteria are complex.
185184

186185
## Conclusions
187186

188-
The _cron/crontab_ system is a very powerful tool for the Rocky Linux systems administrator or desktop user. It can allow you to automate tasks and scripts so that you don't have to remember to run them manually. There are more examples provided here:
187+
The _cron/crontab_ system is a powerful tool for the Rocky Linux systems administrator or desktop user. It allows you to automate tasks and scripts so that you do not have to remember to run them manually. There are more examples provided here:
189188

190189
* For machines that are **not** on 24 hours a day, explore [anacron - Automating commands](anacron.md).
191190
* For a concise description of `cron` processes, check out [cronie - Timed Tasks](cronie.md)
192191

193-
While the basics are pretty easy, you can get a lot more complex. For more information on `crontab` head up to the [crontab manual page](https://man7.org/linux/man-pages/man5/crontab.5.html). On most systems, you can also enter `man crontab` for additional command details. You can also simply do a web search for "crontab" which will give you a wealth of results to help you fine-tune your `crontab` skills.
192+
While the basics are pretty easy, you can get more complex. For more information on `crontab` head up to the [crontab manual page](https://man7.org/linux/man-pages/man5/crontab.5.html). On most systems, you can also enter `man crontab` for additional command details. You can also do a web search for "crontab" which will give you a wealth of results to help you fine-tune your `crontab` skills.

0 commit comments

Comments
 (0)