Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/guides/automation/anacron.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ update : 2021-10-20
## Prerequisites

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

## Assumption
## Assumptions

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

## Anacron Introduction
## `anacron` Introduction

**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.**
**`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.**

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

![ Relations ](../images/anacron_01.png)

## anacron configuration file
## `anacron` Configuration File

```bash
shell > rpm -ql cronie-anacron
Expand Down Expand Up @@ -97,7 +97,7 @@ In order to make certain files run within these automatically defined times, all

Let's use cron.daily to illustrate the execution process of /etc/anacrontab:

1. Anacron reads the ** /var/spool/anacron/cron.daily ** file, and the content of the file shows the time of the last execution.
1. `anacron` reads the ** /var/spool/anacron/cron.daily ** file, and the content of the file shows the time of the last execution.
2. Compared with the current time, if the difference between the two times exceeds 1 day, the cron.daily job will be executed.
3. This work can only be performed from 03:00-22:00.
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.
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/automation/cron_jobs_howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Another way to run jobs at a strictly scheduled time (i.e., day, week, month, ye

Using these `crontab` entries bypasses the `anacron` system and reverts to the `crond.service` whether `anacron` is installed or not.

For our backup script example, if we used use the @daily option to run the backup script at midnight, the entry would look like this:
For our backup script example, if we use the @daily option to run the backup script at midnight, the entry would look like this:

`@daily /usr/local/sbin/backup`

Expand Down
22 changes: 15 additions & 7 deletions docs/guides/automation/cronie.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ update: 2021-10-26
* A machine running Rocky Linux.
* Know how to use your favorite editor to modify the configuration file in the command line environment (this article will use `vi`).
* You have understood the basic knowledge of bash, python or other scripting/programming tools, and expect to run the script automatically.
* You have connected to your machine via ssh (it can be root user or ordinary user with UID greater than 1000)
* You have connected to your machine via ssh (it can be root user or ordinary user with UID greater than 1000).
* We think you are a very cool person.

## cron introduction
## cron Introduction

GNU/Linux provides the *cron* system, which is a time-based `cron` jobs program for automated processes. It is simple, but quite powerful. Want a script or program to run at 5 pm every day? `cron` can do it. There are different branches (or variants) of `cron`, which have the same functions. In this document, **cronie** is used, and the version is 1.5.2. You can click [here](https://github .com/cronie-crond/cronie) to find the latest version and update log.
GNU/Linux provides the *cron* system, which is a time-based `cron` jobs program for automated processes. It is simple, but quite powerful. Want a script or program to run at 5 pm every day? `cron` can do it. There are different branches (or variants) of `cron`, which have the same functions. In this document, **cronie** is used, and the version is 1.5.2. You can click [here](https://github.com/cronie-crond/cronie) to find the latest version and update log.

## cronie's description
## cronie's Description

* **cronie** -package name, Rocky Linux includes cronie by default;
* **crontab** -command to maintain `crontab` (task schedule) for each user;
Expand All @@ -26,7 +26,7 @@ GNU/Linux provides the *cron* system, which is a time-based `cron` jobs program
* **/var/log/cron \* ** -Cronie's log, by default, does log rotation and ends with a date suffix. \* Here means wildcard
* **anacron** -part of cronie . For more information about `anacron`, see [anacron-automation commands](anacron.md).

## `crontab` command
## `crontab` Command

`crontab` is a command obtained after installation of the cronie package. Compared with `anacron`, it is more suitable for servers that work 7 \* 24 hours a day. Common options of `crontab` are:

Expand Down Expand Up @@ -64,18 +64,26 @@ MAILTO=root
|The 4th\*|The month of the year|1-12|
|The 5th\*|Day of the week|0-7 (0 and 7 both indicate Sunday)|

In this example, assuming you are performing this operation as the root user, type the following: `crontab -e`, this will bring up the timed tasks of the root user, if you use `vi` as the default system editor, press <kbd>i </kbd> key to enter the insert mode, enter the following content, # means this is a line of comment. Press <kbd>Esc</kbd> to exit insert mode, enter: wq (displayed at the bottom) to save and exit `vi`, which means to run the script once every night at 22:00. Obviously, this is a very simple example, and the situation can become very complicated when you need to elaborate.
In the example that follows, assuming you are performing this operation as the root user, type the following:

* `crontab -e` which will bring up the timed tasks of the root user. If you use `vi` as the default system editor, press <kbd>i</kbd> key to enter the insert mode.
* "#" means this is a line of comment.

```bash
# Nightly 10:00 backup system
00 22 * * * /usr/local/sbin/backup
```

* Once the above has been entered (again assuming `vi` is the system editor), press <kbd>ESC</kbd> to exit insert mode.
* Save and exit your file with <kbd>SHIFT</kbd>+<kbd>:</kbd>+<kbd>wq!</kbd> (displayed at the bottom of the editor).

Now the script will run every night at 22:00. Obviously, this is a very simple example. Things can become more complicated if you need something more elaborate.

!!! tip "Attention"

The script needs to have execute permission (`chmod +x`) before cronie can run it.

#### Complex options
#### Complex Options

So far, the content discussed are very simple options, but how to complete more complex timed tasks?

Expand Down
14 changes: 7 additions & 7 deletions docs/guides/automation/templates-automation-packer-vsphere.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You can also choose not to convert the virtual machine into a template, in this

### Introduction to Packer

Packer is an open source virtual machine imaging tool, released under the MPL 2.0 license and created by Hashicorp. It will help you automate the process of creating virtual machine images withpre-configured operating systems and installed software from a single source configuration in both, cloud and on-prem virtualized environments.
Packer is an open source virtual machine imaging tool, released under the MPL 2.0 license and created by Hashicorp. It will help you automate the process of creating virtual machine images with pre-configured operating systems and installed software from a single source configuration in both, cloud and on-prem virtualized environments.

With Packer you can create images to be used on the following platforms:

Expand All @@ -58,7 +58,7 @@ You can have a look at these resources for additional information:

### Installing Packer

There are two ways of install Packer in your Rocky Linux system.
There are two ways to install Packer on your Rocky Linux system.

#### Installing Packer from the Hashicorp repo

Expand Down Expand Up @@ -119,7 +119,7 @@ $ sudo mv packer /usr/local/bin/

If all the steps of the previous procedures have been completed correctly, we can proceed to verify the installation of Packer on our system.

To verify that Packer has been installed correctly, run the packer command and you will get the result shown below:
To verify that Packer has been installed correctly, run the `packer` command and you will get the result shown below:

```bash
$ packer
Expand All @@ -142,7 +142,7 @@ Available commands are:

It is assumed that you are on Linux to perform the following tasks.

As we will connect to a VMware vCenter Server to send our commands via Packer, we need to store our credentials outside the configuration files that we will create next.
As we will connect to a VMware vCenter Server to send our commands via Packer, we need to store our credentials outside the configuration files which we will create next.

Let's create a hidden file with our credentials in our home directory. This is a json file:

Expand Down Expand Up @@ -236,13 +236,13 @@ In a first step, we declare variables, mainly for the sake of readability:

We will use the variable `version` later in the template name we will create. You can easily increment this value to suit your needs.

We will also need our booting virtual machine to access a ks.cfg (Kickstart) file.
We will also need our booting virtual machine to access a `ks.cfg` (Kickstart) file.

A Kickstart file contains the answers to the questions asked during the installation process. This file passes all its contents to Anaconda (the installation process), which allows you to fully automate the creation of the template.

The author likes to store his ks.cfg file in an internal web server accessible from his template, but other possibilities exists that you may chose to use instead.
The author likes to store his `ks.cfg` file in an internal web server accessible from his template, but other possibilities exists that you may chose to use instead.

For example, the ks.cfg file is accessible from the VM at this url in our lab: http://fileserver.rockylinux.lan/packer/rockylinux/8/ks.cfg. You would need to set up something similar to use this method.
For example, the `ks.cfg` file is accessible from the VM at this url in our lab: http://fileserver.rockylinux.lan/packer/rockylinux/8/ks.cfg. You would need to set up something similar to use this method.

Since we want to keep our password private, It is declared as a sensitive variable. Example:

Expand Down
5 changes: 5 additions & 0 deletions docs/guides/cms/cloud_server_using_nextcloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ tags:
* A high degree of comfort operating from the command line for installation and for configuration.
* Knowledge of a command-line editor. For this example, we are using _vi_, but you can use your favorite editor if you have one.
* While Nextcloud can be installed via a snap application, we will be documenting two installation methods, the module and the .zip file.

!!! note "Specifics for Rocky Linux 9.0"

You will need to use the .zip file install method for Rocky Linux 9.0 as the module does not exist on 9.0.

* We will be applying concepts from the Apache "sites enabled" document (linked to down below) for directory setup in the .zip file method.
* We will also be using the _mariadb-server_ hardening procedure (also linked to later) for database setup.
* Throughout this document we will assume that you are root, or that you can be by using _sudo_.
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/containers/lxd_web_servers.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ If you want to use IPv6 on your LXD containers, you can turn on this next option
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
```

This is necessary to easily back up the server, and can allow you to manage your LXD install from other computers. If that all sounds good to you, answer "yes" here/
This is necessary to easily back up the server, and can allow you to manage your LXD install from other computers. If that all sounds good to you, answer "yes" here

```
Would you like the LXD server to be available over the network? (yes/no) [default=no]: yes
Expand Down Expand Up @@ -570,7 +570,7 @@ If you have `curl` installed on your server host, you can make sure the default
curl [container-ip-address]
```

Remember, you can see all contkainer IPs with `lxc list`. And if you install curl on all your containers, you *could* just run:
Remember, you can see all container IPs with `lxc list`. And if you install curl on all your containers, you *could* just run:

```bash
curl localhost
Expand Down Expand Up @@ -844,7 +844,7 @@ lxc exec apache-server systemctl restart httpd && lxc exec nginx-server restart
That will apply the "real-ip.conf" files we made to their respective server configurations.

#### Getting SSL certificates for your websites
Getting official, proper SSL certificates is easiest with Let's Encrypt, and a little application called certbot. certbot will automatically detect your websites, get SSL certificates for them, and configure the sites itself. It will even renew the certificates for you every 30 days or so, without any intervention from you or cron jobs.
Getting official, proper SSL certificates is easiest with Let's Encrypt, and a little application called certbot. certbot will automatically detect your websites, get SSL certificates for them, and configure the sites themselves. It will even renew the certificates for you every 30 days or so, without any intervention from you or cron jobs.

This all has to be done from the "proxy-server" container, so log into that shell. Once there, install the EPEL repositories, just like you did on the host. Make sure the container is updated first:

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/containers/podman-nextcloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ And here's the code you'll need:

!!! warning

For the purposes of this guide, the following script will deleted all Podman Volumes. If you have other applications running with their own volumes, modify/comment the line "podman volume rm --all";
For the purposes of this guide, the following script will delete all Podman Volumes. If you have other applications running with their own volumes, modify/comment the line "podman volume rm --all";

```
#!/bin/bash
Expand Down Expand Up @@ -419,7 +419,7 @@ podman run --name nextcloud --net host --privileged -d -p 80:80 \
nextcloud ;
```

Save and close that out,, make all of your scripts executable, then run the image building script first:
Save and close that out, make all of your scripts executable, then run the image building script first:

```bash
chmod +x *.sh
Expand Down
5 changes: 3 additions & 2 deletions docs/guides/contribute/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ Once completed, you can try running `mkdocs serve` to see if you get your desire

## Navigation and Other Changes

Navigation is handled with mkdocs `.pages` files. Are not terribly complex, BUT, if something is left out, it can cause the server to fail to load. That's why this procedure is **ONLY** for Managers and Editors. These individuals are going to have the tools in place (local install of mkdocs, plus clones of both documentation and docs.rockylinux.org) so that something pushed and merged to GitHub will not break the serving of the documentation website. A contributor cannot be expected to have even one of these requirements in place.
Navigation is handled with mkdocs `.pages` files **OR** by the value of the "title:" meta in the document front matter. The `.pages` files are not terribly complex, BUT, if something is left out, it can cause the server to fail to load. That's why this procedure is **ONLY** for Managers and Editors. These individuals are going to have the tools in place (local install of mkdocs, plus clones of both documentation and docs.rockylinux.org) so that something pushed and merged to GitHub will not break the serving of the documentation website. A contributor cannot be expected to have even one of these requirements in place.


### `.pages` Files

As already stated, the .pages files are generally pretty simple. They are a YAML formatted file that `mkdocs` reads before rendering the content. To take a look at one of the more complex `.pages` files, let's look at the one created to help format the side navigation:
As already stated, the `.pages` files are generally pretty simple. They are a YAML formatted file that `mkdocs` reads before rendering the content. To take a look at one of the more complex `.pages` files, let's look at the one created to help format the side navigation:

```
---
Expand Down
Loading