Topic 8

Dates: 3/8/2017
Start-up and Run Levels. Scheduled jobs (at, cron)
Linux System Administration

Practical Exercises with at and cron

Complete the exercises below on run01 VM

Install package at:
apt-get install at
As user hostadm, Create script,, to check memory status:
# Checks memory status through cron


echo "Memory status (in MB) on $dt:" >> $of 
free -m >> $of
echo "------------------" >> $of 
Make it executable
chmod 755
and run through at:
at -f now + 1 minute
Run atq to make sure the job is scheduled. In a minute, check content of a new file, mem.out; run atq again.

Remove file mem.out. Add the following entry in /etc/crontab below the other scheduled tasks:
*/2 * * * *  root  /home/hostadm/ 
Check if the content of mem.out is updated every 2 minutes.

Take me to the Course Website