Question: Part 1 : In this 2 part lab, you will perform a series of tasks related to task scheduling using crontab and at , as

Part 1:
In this 2 part lab, you will perform a series of tasks related to task scheduling using
crontab and at, as well as managing background processes using fg.
Crontab Task Scheduling:
Objective: Schedule a task to automatically delete temporary files every Sunday at
11:00 PM.
Instructions:
Use crontab -e to open the crontab editor.
Add an entry to execute the command rm -rf /tmp/* every Sunday at 11:00 PM.
Save and exit the crontab editor.
At One-Time Task Scheduling:
Objective: Schedule a one-time task to print a reminder message in 30 minutes.
Instructions:
Use the at command to schedule the printing of a reminder message in 30 minutes.
Recurring Crontab Task:
Objective: Schedule a task to automatically update the system's package cache
every day at 3:00 AM.
At One-Time Task Execution:
Objective: Schedule a one-time task to run a script named backup.sh tomorrow at
8:00 AM.
Foreground Process Management:
Objective: Start a long-running command or script in the background and bring it to
the foreground using fg.
Instructions:
Start a command (e.g., ping) in the background using &.
Use the jobs command to list background jobs and their IDs.
Bring the background job to the foreground using fg.
Scheduled Task Verification:
Objective: Verify that the scheduled tasks in crontab and at have been correctly set
up.
Instructions:
Use crontab -l to list the contents of your crontab and ensure that the scheduled
tasks are present.
Use atq to list the pending at jobs and confirm that the one-time task is scheduled.
Temporary Task Scheduling:
Objective: Schedule a one-time task to reboot the system in 10 minutes using at.
Cleanup:
Objective: Remove all scheduled tasks and clean up background processes.
Instructions:
Remove all scheduled tasks from crontab using crontab -r.
Cancel all pending at jobs using atrm $(atq -q).
Terminate any remaining background processes.
Notes:
Ensure that you replace /path/to/backup.sh with the actual path to the backup script
in Task 4.
Verify the successful scheduling and execution of tasks using appropriate
commands (crontab -l for crontab, atq for at).
Experiment with different background processes and tasks to gain familiarity with
process management command

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!