0% found this document useful (0 votes)
36 views2 pages

Scheduling in OS

Unix allows scheduling of commands to run at later times using the at command. At allows scheduling a command to run at a specified time, displaying a list of scheduled jobs, and removing jobs. Example usages include running a job at 11:00pm or 6:30pm next week. The atq command can list scheduled jobs in order of earliest time. Crontab allows scheduling jobs to run at regular intervals, with fields for minutes, hours, day of month, month, day of week, and command. For example, a job could run every Friday at 4:00pm.

Uploaded by

Hardik Darji
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

Scheduling in OS

Unix allows scheduling of commands to run at later times using the at command. At allows scheduling a command to run at a specified time, displaying a list of scheduled jobs, and removing jobs. Example usages include running a job at 11:00pm or 6:30pm next week. The atq command can list scheduled jobs in order of earliest time. Crontab allows scheduling jobs to run at regular intervals, with fields for minutes, hours, day of month, month, day of week, and command. For example, a job could run every Friday at 4:00pm.

Uploaded by

Hardik Darji
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Scheduling :-

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 :-

-l Display a list of jobs scheduled by you.


-m Mail a report of successful execution of the jobs.
-t date Schedule a job to be executed at the specified date and time.
-r joblist Remove the jobs specified in the jobs list from the queue.

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.

AtQ :- Can be used to list the jobs scheduled at a later time.

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.

Crontab file of the following fields (Seperately spaces or tabs)

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.

You might also like