-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba3b560
commit 9a53ab6
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Problem Statement | ||
|
||
The Nautilus system admins team has prepared scripts to automate several day-to-day tasks. They want them to be deployed on all app servers in Stratos DC on a set schedule. Before that they need to test similar functionality with a sample cron job. Therefore, perform the steps below: | ||
|
||
a. Install *cronie* package on all Nautilus app servers and start crond service. | ||
|
||
b. Add a cron */5* ** * echo hello > /tmp/cron_text for root user. | ||
|
||
## Solution | ||
|
||
### 1. SSH into the First App Server | ||
|
||
```bash | ||
ssh tony@stapp01 | ||
``` | ||
|
||
### 2. Switch to the Root User | ||
|
||
```bash | ||
sudo su | ||
``` | ||
|
||
### 3. Install the *cronie* Package | ||
|
||
```bash | ||
yum install cronie -y | ||
``` | ||
|
||
### 4. Start the `crond` Service | ||
|
||
```bash | ||
systemctl start crond | ||
systemctl enable crond | ||
``` | ||
|
||
### 5. Edit the Root User’s Crontab | ||
|
||
Open the crontab editor for the root user: | ||
|
||
```bash | ||
crontab -e | ||
``` | ||
|
||
In the editor, add the following line to schedule the job to run every 5 minutes: | ||
|
||
```bash | ||
*/5 * * * * echo hello > /tmp/cron_text | ||
``` | ||
|
||
### 6. Verify the Crontab Entry | ||
|
||
```bash | ||
crontab -l | ||
``` | ||
|
||
You should see the following line in the output: | ||
|
||
```bash | ||
*/5 * * * * echo hello > /tmp/cron_text | ||
``` |