5.2 Cron and Scheduled Jobs Flashcards
A _________ is a script or command designated to run at periodic predetermined intervals.
A cron job is a script or command designated to run at periodic predetermined intervals.
What is a daemon?
A daemon is a computer program that runs as a background process, rather than being directly controlled by an interactive user.
What is Cron?
cron is a robust task scheduler that allows users to schedule repetitive tasks to run on a regular basis.
____________are often started at boot up. While other
____________ respond to network requests and hardware activity, cron is initiated at designated time intervals.
Daemons are often started at boot up. While other
daemons respond to network requests and hardware
activity, cron is initiated at designated time intervals.
Tasks are stored and scheduled in a file called a ___________.
Tasks are stored and scheduled in a file called a crontab (cron table).
- Each user has their own individual, private crontab.
- System crontabs for system level actions.
- Tasks scheduled by users. are run under that user’s privilege level.
- Root users can have a crontab too.
Crontabs come in two varieties. What are they?
- User-level: runs for a specific user under their privilege level.
- System-level: runs for the system as a whole under root privileges.
What is the general syntax for a crontab?
minute hour day-of-month month day-of-week command
What goes in this directory?
/etc/cron/d
custom cron jobs
Lynis is a security scanner used to ____________________.
Lynis is a security scanner used to check a machine for vulnerabilities.
- Generates and saves reports of its findings for administrators to review.
- Offers numerous scan types.
- When will the following
cron
schedules run?*/10 * * * *
At every 10th minute.
- What event is the following
cron
a minute away from?
59 23 31 12 *
New years
What do the following hypothetical cron
likely do?
0 18 * * 1-5 /home/Bob/Sales/sum_of_sales.sh
- Run a script that adds up all the sales for the work day.
2. A weekly automated system upate.
What is a shebang?
Is the commented file declaration at the top of a shell script.
Is the .sh
extension needed for shell scripts?
Nope! As long as the shebang is there, the file should be able to run as a script!
What two characters should come before the filename of a script?
./
Jane’s script has user and group ownership of a script with -rw-r--r--
permissions, but she cannot get it to run. What must she do to the file before it will run?
Run chmod +x
on her file!
How does the -x
option modify the tar
command?
This option will let tar
extract an archive!
If a directory has ten
files and the following command is used in it, how many files are being archived?
tar cvvWf backups/archive.tar
Zero, because tar doesn’t compress!! But all files should be archived as they’re all in ., the current directory!
What option prints the full file specification of files as you interact with them?
-vv
Why is the -f
option used in almost every tar
operation?
The -f
option lets you designate a tar
file to either create or extract or list from.