Chapter 12 - Scheduling Tasks Flashcards
What is cron service?
cron service is used as a generic service to run processes automatically at specific times.
What does crond or the cron daemon do?
The crond daemon wakes up every minute and checks its configuration to see whether anything needs to be started.
What are the two components of cron?
cron daemon (crond) and the cron configuration which defines what job it has to do
Which command to monitor the status of cron service?
systemctl status crond -l
Where is the main configuration file for cron located?
/etc/crontab
How to create user specific cron job?
After logging in as that user, type crontab -e or when logged is as root, type : crontab -e -u username
What is the purpose of anacron?
To ensure regular execution of the job, Cron uses the anacron service. This service takes care of starting the hourly, daily, weekly, and monthly cron jobs, no matter at which exact time.
Which command to see a list of cron jobs for the current user account?
crontab -l
How to manage cron security i.e limit which user to allow to schedule cron jobs and which user not to?
Using the /etc/cron.allow and /etc/cron.deny files.
Only root user can use the cron if neither file exists
What is the at command , atq command and atrm command? And how different is at from cron
Whereas cron is used to schedule jobs that need to be executed on a regular basis, the atd service is available for services that need to be executed only once.
at command is used to run a job through the atd service
atq command is used to see a list of all the scheduled jobs in atd service
atrm command is used to remove the scheduled jobs
how to scheduled a job using the at command?
To run a job through the atd service, you would use the at command, followed by the time the job needs to be executed. After you type this, the at shell opens. From this shell, you can type several commands that will be executed at the specific time that is mentioned. After entering the commands, press Ctrl-D to quit the at shell.