Professional Documents
Culture Documents
Unix gives you the ability to schedule scripts and commands for execution at some later time.
You can specify the exact time when the command should be run.
Also provide a way of reporting on the scheduling jobs and removing them if you don’t execute
them.
At :-
allows you to do
(1) Scheduling a command for execution at a specified time.
(2) Display a list of scheduled jobs.
(3) Removing jobs from the specified jobs list.
Flag :-
Example:- my job at 11:00 -> assuming that current time is 9:30 p.m.
at 2300 my job
at 23:00 my job
at 11:00 p.m. my job
at 23:00 today my job
at now + 6 hours my job
at 6:30 p.m. next week my job.
The jobs are displayed in the order of time at which the earlier-scheduled jobs displaled first.
Flag :-
-c -> Display a list of jobss in order of time at which the at command was
executed to schedule the jobs.
-n -> Display the number of scheduled jobs.
Crontab :- Unix system have a daemon running all the time that can run jobs at
regularly scheduled intervals.
minutes
hour
day
year
day of the week
command
Example :- lunch at 12:20 then
30 12 * * * * echo “Tome to go for lunch “
If you want to execute my job on Friday at 4:00 p.m. every week then
0 16 * * 5 my job.