1). What is the difference between invoking a job serially and in parallel?
A) In UNIX/Linux, the invocation of a program is also called a job or task. To distinguish between a job (task) and process, consider the invocation of a program as a single job or single task, no matter how many processes are actually created for that invocation.
In many cases, a job is handled by one process, and when this process is finished, the job is finished, and the initial program invocation is also finished.
Serial invocation: A series of processes will run with a single job, one after another. System will not accept and start a new job through that command line until the current job finishes
Parallel invocation: Unlike serial jobs and processes, which run in sequence one after the other, parallel jobs and processes run concurrently, or at the same time with other jobs and processes.
This means that you do not wait for one parallel job or process to end before another begins
2). What does it mean to background a job? Why is back grounding useful?
A) Typically, you want to issue jobs serially, which is the default way that command-line entry works. However, you may initially issue a job serially, and then you later decide to run it as a parallel job.
For example, suppose you invoke xcalc serially. You later realize you want to do something else in that window, but you do not want to quit the xcalc job.
Instead, you want the xcalc job to run as a parallel job so that you can do other work through that command line. To accomplish these needs, you change the serial job to a parallel job.
To change a serial job to a parallel job, UNIX allows you to background the job—meaning it runs behind the scenes, or in other words, runs invisibly in the command line so that you can issue other jobs through the command line.
Back grounding is useful, so we can do foreground work.
3). Give the command(s) to bring the largest_prime job to the foreground?
A).
$ jobs
$largest_prime 500000
Give the command(s) to background the now foregrounded largest_prime from the last question?
A).
$largest_prime 50000 &
Give the command(s) to bring the xcalc job to the foreground?
$ jobs
$xcalc
- Can always be used to terminate a job?
Yes
- Other than , explain another way to terminate a job.
$kill -9 pid
- Issue a process listing of only processes associated with that command line or terminal window?
$ps
- Issue a process listing of all processes in the system?
$ ps -e
- Issue a process listing that shows only entries that contain the text largest_prime?
$ps -l
- Give the command to terminate the repeat_sleep process?
$ kill -9 1158
- Give the command to terminate the largest_prime process?
$kill -9 2577
- Give the command to terminate the repeat_sleep process?
$kill -9 2642
- Modify the second scheduled crontab job so that it occurs at midnight (12:00 A.M.)?
00 12 * * * /home/ramesh/bin/incremental-backup
- Modify the third crontab job in so that it occurs every Friday at 2:00 A.M?
00 02 * * 05 /home/ramesh/bin/incremental-backup
- Modify the first crontab job in so that it occurs every fifteen minutes, starting at the beginning of every hour?
15 * * * * /home/ramesh/bin/incremental-backup
- Create a crontab entry to schedule the program every_tuesday to be invoked at 6:00 P.M?
* 18 * * 02 /home/ramesh/bin/incremental-backup
Crontab Options
minute: 0-59
hour: 0-23
day of month 1-31
month: 1-12 (or names; see example below)
day of week: 0-7 (0 or 7 is Sunday,1 – Monday)
Crontab Examples
One thought
Comments are closed.