A technique for scheduling tasks to be run at a specific time or on a specific event.

learn more… | top users | synonyms

30
votes
8answers
51k views

Where are cron errors logged?

If I setup cron jobs incorrectly they appear to silently fail. Where should I look for an error log to understand what went wrong?
23
votes
1answer
2k views

High CPU usage with CFS?

I asked a previous question to try and isolate the source of an increase in CPU usage when moving an application from RHEL 5 to RHEL 6. The analysis that I did for that seems to indicate that it is ...
13
votes
2answers
650 views

What is a simple way to schedule a single event to happen at some time in the future?

There are often times that I want my computer to do a single task, but not right now. For example, I could have it notify me in 30 minutes that it is time to leave work. Or maybe I want it to run a ...
12
votes
2answers
43k views

How can get a list of all scheduled cron jobs on my machine?

My sysadmin has set up a bunch of cron jobs on my machine. I'd like to know exactly what is scheduled for what time. How can I get that list?
11
votes
2answers
309 views

What are the effects, if any, of scheduler priorities and policies for threads in an uncontended cpuset?

I have a Linux system where we have used cgroups to create two cpu_exclusive cpusets, A and B, and where we have migrated all user threads and all unbound kernel threads to a cgroup attached to cpuset ...
9
votes
1answer
193 views

Cronjob to Run and then Terminate

I want to add a cron entry that does something like: 00 00 * * * * /tmp/script.sh Is there something I can add to the end of the line, so that when it is finished, it will remove the line out of my ...
8
votes
2answers
7k views

Bash Script on Startup? (Linux)

Is there any way to make/run a bash script on reboot (like in Debian/Ubuntu for instance, since thats what my 2 boxes at home have) Also, any recommended guides for doing cron jobs? I'm completely ...
8
votes
3answers
629 views

how to queue a command to run after another command finishes?

Sometimes I start a program that takes a very long time to finish (emerge), then realize that I should go to bed instead of waiting for it. If I know this in the first place I would run program; halt ...
8
votes
1answer
706 views

Why can a system become unresponsive?

I just executed dot (a program for drawing directed graphs) with an input file that was so big that it couldn't be rendered in a reasonable amount of time. My whole system froze. I could barely make ...
8
votes
1answer
575 views

How is nice working?

sched_setscheduler says : All scheduling is preemptive: if a process with a higher static priority becomes ready to run, the currently running process will be preempted and ...
8
votes
1answer
174 views

What does a computer actually do with its spare CPU cycles?

When a computer is not running at full load, in the context of Linux, what does it actually do? Between scheduled threads, if there is nothing to do, does it spin wait? Does it enter some sleep state? ...
8
votes
1answer
3k views

Isolating cause of higher CPU usage on RHEL 6 vs RHEL 5

I'm currently looking to move our system from RHEL 5 to RHEL 6, but I've run into a snag with unexpectedly high CPU usage on the RHEL 6 machines. It appears that this may be due at least in some part ...
7
votes
3answers
2k views

How to shutdown Linux at a specific datetime from terminal?

It seems I can shutdown using sudo shutdown by specifying a time or minutes. Is there a way to specify datetime for shutdown?
7
votes
1answer
2k views

How can you schedule a computer to boot at a specific time?

Usually BIOSes have an option to schedule a time to which to boot at. Is there a Unix/Linux interface to specify the scheduled boot?
7
votes
3answers
3k views

Which Scheduling algorithm is used in Linux?

Recently in an interview I was asked about the Scheduling algorithm used by Linux Operating system. What is the algorithm used any why? Also, what algorithm is used in in real-time operating systems ...
7
votes
2answers
2k views

How can you determine which process scheduler is being used? [duplicate]

I.e. is it the O(1) scheduler, the CFS scheduler, or an older one?
7
votes
1answer
223 views

Prioritise X applications with focus

Is there a way to prioritise X applications with focus, preferably both in terms of CPU and I/O? Something like all X applications are niced and ioniced down in priority, but when they gain focus ...
6
votes
4answers
444 views

Scheduling commands by system inactivity

So cron or at can schedule our commands to run at the exact time we need them to, but can we schedule commands to run when systems are inactive? Something like: echo "some_commands" | when 'cpu ...
6
votes
2answers
151 views

Why are there so few “running” processes?

On all of BSD/Linux/MacOS and Solaris, I made an observation - no matter how busy the system is, top always reports very few (usually 1-2) running processes. According to my limited understanding, a ...
6
votes
1answer
1k views

How do I view the IO priority of a process?

How can I view the IO priority of a process? like to see for example if something has been ionice-ed.
6
votes
1answer
455 views

Why mkfifo behaves like a LIFO?

If i do. mkfifo /tmp/a echo 'one'>/tmp/a in the while from another terminal echo 'two'>/tmp/a and from a third terminal more /tmp/a Why i obtain as output of the last command this? ...
6
votes
3answers
661 views

Simple queuing system?

Given a commodity PC, we would like to use it to execute some tasks in the background round the clock. Basically, we would like to have commands like: add-task *insert command here* list-tasks ...
6
votes
2answers
1k views

Does Linux kernel 3.x use the CFS process scheduler?

Does the latest version of the Linux kernel (3.x) still use the Completely Fair Scheduler (CFS) for process scheduling which was introduced in 2.6.x ? If it doesn't, which one does it use, and how ...
5
votes
2answers
2k views

Is there a workaround for a lack of scheduler in qbittorrent?

Unlike many other torrent clients, qbittorrent comes without a scheduling tool. Ideally, one can throttle downloads over a certain time of the day, on given days. Is there a workaround for this? Is ...
5
votes
1answer
94 views

Is the Unix process scheduler itself a process?

Is the Unix process scheduler itself a process, or does it piggyback on other processes in the same way a system call does (running kernel code in the user process with the kernel bit set)?
5
votes
1answer
462 views

Linux process scheduling - Cap/Weight based?

I am just trying to understand the basics of Linux scheduler. Is Linux scheduler a Cap based or weight based scheduler? I was previously using Xen. Now I am moving from Xen to KVM. I read VMs are ...
4
votes
2answers
249 views

Schedule job at irregular intervals

It's simple enough to use cron to schedule a job to occur periodically. I'd like to have something occur less regularly -- say, run the job, then wait 2 to 12 hours before trying again. (Any ...
4
votes
2answers
997 views

How preemption works on Linux when a program has a timer less then 4ms?

Jiffies in most Linux system are defaulted to 250 (4ms). The questions is that what happens when a program has a usleep() less then 4ms ? Of course it works as should when it is scheduled. But what ...
4
votes
3answers
415 views

GNU: Delayed jobs Queue

Is there a simple way for me to add a shell command to a list of jobs to have run on the system when I'm not logged in? For example: I SSH into my system, decide that I want to read an ebook later, ...
4
votes
4answers
741 views

How to prevent atd from running past jobs?

The at daemon is a great tool! However, if a job is scheduled for 8:00 am and the machine is off at that time, at will run the job whenever the machine is booted. What I would like to do is stop it ...
4
votes
1answer
702 views

How is cron scheduling actually implemented and makes sure scripts run on time?

I want to ask about cron jobs. OK, we place the scripts in the crontab and the cron daemon executes them. Now if I understand this, each minute, cron checks the crontab of each user and executes the ...
4
votes
1answer
305 views

Are there any Workload Management subsystems for Linux?

Asked this on superuser, got no response: Can anyone tell me of the status/state of WLM (Workload Management) kernel scheduler systems in Linux? Alternatively, any user-space process goal-based load ...
3
votes
2answers
471 views

How does a script/program executes in unix?

I have a doubt about the execution pattern of a unix script. For example a script containing lines: command B function C() { Myscript // Myscript is a script command D } command E and ...
3
votes
2answers
610 views

How do I execute a script later?

I need to compile gcc45 on my computer and that's a lengthy and resource-intensive process for my computer, so I'd prefer to have it do it while I sleep (at night). What's the closest thing to: $ ...
3
votes
2answers
2k views

Add a one-off scheduled task through a shell script?

I'd like to execute a task at a given time, once. I know I can just use crontab -e to add it there, but I'd like to do that through a shellscript. crontab -e gives me some temporary file to edit ...
3
votes
1answer
12 views

Which process scheduling algorithm is used by Linux?

The Linux operating system switches between running processes to enable multi-tasking. What algorithm is used to determine when to suspend the execution of the currently running process and which ...
3
votes
3answers
244 views

Changing the disk scheduler on the fly

Can the Linux disk scheduler be changed on the fly by writing to /sys/block/sda/queue/scheduler? Should applications (e.g. Mysql) be stopped / started when changing?
3
votes
3answers
126 views

stopping atd job at specified time

I'm trying to schedule download at nights. I have created a atd job which starts download script at 2 AM. Now I want to stop the same job at 7 AM if it is still running. What I'm doing now is just ...
3
votes
2answers
9k views

What does “INFO: task XXX blocked for more than 120 seconds” exactly mean on Linux?

I had this message in my kernel log : INFO: task XXX blocked for more than 120 seconds. I would like to know what it means technically: under what conditions does the kernel display this message about ...
3
votes
3answers
1k views

Bash while loop and reading from pipe

I have a Windows command-line program that I'm running in a Bash script in Ubuntu via wine. The Bash script basically looks like this: wine myprogram.exe | while read line do # Process line done ...
3
votes
3answers
2k views

How to schedule something run once using anacron?

Frequently within my scripts I schedule auxiliary tasks for later in the form: at now + 8 hours <<< "rm -f workfile.$$ >> $worklog 2>&1 " or at 11pm + $(date +%M) minutes ...
3
votes
1answer
566 views

Scheduled task on reboot

How can I schedule a task to run on next reboot? I understand that we have tools like cron and at to help with scheduling. But they seem to allow scheduling at a specific time and not on specific ...
3
votes
1answer
64 views

What's the easiest way to set up a 2-hour alarm?

I want my computer to play some given .mp3 every 2 hours. I want it to run at startup, and be modifiable with a given .conf file. The choice of .mp3 will also be in the .conf file. The reason is, I ...
3
votes
2answers
39 views

Trigger job only once and only when load is low

I'd like have automatic update of my gtags, but only when the system is idle. To achieve this, I'm using iupdate to watch over the interesting parts of my source folder. But I have a problem with the ...
3
votes
1answer
300 views

Unix/Linux process scheduler logs

Where can I actually see what decisions did a process scheduler make over a time period? Are there scheduling specific logs maintained by Unix/Linux systems I could take a look or should I be looking ...
3
votes
1answer
446 views

chrt(): “failed to set pid XXX's policy” on one machine, but not others

I have several Linux machines, all of them running the same kernel (Ubuntu 12.04, 3.5.0-45-generic). On one of them, I am unable to use chrt at all. If I attempt to use it on a new process, I get the ...
3
votes
1answer
379 views

Using sched_rt_period_us for setting maximum time between task calls of order of 10ms

I realize sched_rt_period_us and sched_rt_runtime_us are meant to prevent freezing the system in case of runaway RT task. I wonder though, if it's possible to use a small value of sched_rt_period_us ...
2
votes
1answer
232 views

What makes the Linux scheduler seem unpredictable?

The question refers to the output of a multi-threaded application, where each thread merely prints its ID (user assigned number) on the standard output. Here all threads have equal priority and ...
2
votes
3answers
400 views

scheduling background tasks in succession

I've got three SAS programs to run in the background over a weekend. The three programs output information into files of the same names, so I'll need to remove these output files after the first ...
2
votes
3answers
2k views

Conditional crontab command in bash script

How do I invoke a crontab command so that I can schedule to run a script with a 20 minute delay based on some condition? Edit: What if I wanted a command that schedules a script to be executed only ...