CIT054 Index > Assignment: Periodic Processes

Assignment: Periodic Processes

You will do this assignment on the server. In the following instructions, filename refers to the file /tmp/lastname_firstname. Thus, if your name is Diane Arbus, every time you see filename, you should write /tmp/arbus_diane

Use crontab -e to edit your crontab to do the following. Each of these will be done with a single line in the crontab file.

  1. At 2:45 PM every day, this command will occur:

    echo "A quarter to three. $(date)" >> filename
  2. At 10 AM, 2PM, and 4 PM every day, this command will occur:

    echo "It's Dr. Pepper (TM) time. $(date)" >> filename
  3. Every Thursday at 6 PM, this command will occur:

    Echo "Time to go to class. $(date)" >> filename
  4. Every hour on the hour Saturday and Sunday, this command will occur:

    echo "cron works weekends. $(date)" >> filename
  5. Figure out whatever day and month tomorrow will be; on that day at 2 AM, this command will occur:

    echo "Closing time. $(date)" >> filename

When You Finish

Use crontab -l (that’s the letter ell, not the digit one) to list your crontab file; redirect the output of the command to a file named lastname_firstname_cron.txt and mail that file to the instructor.

Extra Note

If you want to see the tasks that the system runs with cron, look at these files and directories: /etc/crontab, /etc/cron.daily, /etc/cron.hourly, /etc/cron.monthly, and /etc/cron.weekly