- Lab
- A Cloud Guru
Scheduling Processes in SUSE Linux Enterprise
In this hands-on lab, we will be looking at scheduling processes to run on a schedule. We will perform some troubleshooting on a user account to ensure the process is working correctly, and then we will create a task as the `root` user to ensure our time is synced correctly on our server.
Path Info
Table of Contents
-
Challenge
Verify the `testuser` Can Create Scheduled Tasks
-
Access the
testuser
's account:su - testuser
The password is
Password!
-
Create a file named
test.sh
that echoes the string "this is a test" into anexamplefile
:vim test.sh ++contents #! /bin/bash echo 'this is a test' >> /home/testuser/examplefile
Save and exit the file with Escape and then Shift+ZZ.
-
Make the file executable:
chmod +x test.sh
-
Open
testuser
's crontab and add a task:crontab -e
-
Add this line:
* * * * * /home/testuser/test.sh
Save and exit with Escape and then Shift+ZZ.
-
Tail the file
examplefile
and ensure a line is appended every minute:tail -F examplefile
-
Hit Ctrl+C to quit.
-
Remove the task from the crontab:
crontab -e
-
On the line with the task, press
d
twice. -
Save and exit with Escape and then Shift+ZZ.
-
-
Challenge
Create a Task as `root` that Syncs the System Clock to the Hardware Clock
-
Open the
root
crontab:sudo -i crontab -e
-
Add the task to run the backup at 3 AM:
SHELL=/bin/bash PATH=/sbin 00 03 * * * /usr/local/bin/customback /opt/programdata
Save and exit with Escape+X.
-
Verify the task exists in the
root
crontab:sudo -i crontab -l
-
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.