Questions tagged [scheduling]

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

Filter by
Sorted by
Tagged with
194
votes
3answers
481k 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?
169
votes
9answers
367k 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?
43
votes
3answers
136k 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?
25
votes
1answer
4k 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 ...
23
votes
1answer
27k views

Real time processes scheduling in Linux

I have been learning some scheduling concepts. Currently my understanding so far is as below. There are real time processes and non real time processes. Non real time processes can have nice values ...
21
votes
2answers
2k views

Why does niceness range from -20 to 19?

The nice command allows you to adjust the scheduling priority ("niceness") of a program. On all Unix-like systems I've used, niceness is specified by a range of integers, where -20 is the most ...
20
votes
1answer
7k 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 ...
19
votes
4answers
16k views

Is there a way to auto turn-on Linux machine?

I know that there are many ways to auto-shutdown, but I'm concerned about auto turn-on. Is there a command or a small piece of software to turn on the system at given time?
19
votes
1answer
7k 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.
19
votes
1answer
909 views

Does `at` run a command later if the computer is off at the specified time?

I want to schedule jobs with at, but I'm not sure what happens if the computer is suspended at the specified time: Will the command be executed as soon as the computer wakes up again (like with ...
18
votes
2answers
21k views

Run script every 30 min with systemd

I would like to execute a script every 30 min after booting into the system. I know you can use cron, but I don't plan to use this feature often therefore I'd like to try it with systemd. So far I ...
16
votes
2answers
22k views

How to enable and use the BFQ scheduler?

I just installed Linux kernel version 4.12 on Ubuntu 17.04 using ukuu (Ubuntu Kernel Update Utility https://doc.ubuntu-fr.org/ubuntu_kernel_upgrade_utility). The thing is, when I check the available ...
15
votes
3answers
1k views

What was the reason of the non-preemptivity of older Linux kernels?

Why did the first Linux developers choose to implement a non-preemptive kernel? Is it to save synchronization? As far as I know, Linux was developed in the early '90s, when PCs had a single processor....
15
votes
2answers
2k 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 ...
14
votes
2answers
40k 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 ...
13
votes
2answers
14k 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 ...
12
votes
1answer
2k 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 ...
12
votes
3answers
11k views

Start/stop a systemd.service at specific times

I want to start and stop a systemd.service at specific times. Presumably I will use a .timer unit to start the job, but is there a built in way to stop the job after a specific duration, or at a ...
11
votes
5answers
16k 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 ...
11
votes
3answers
14k 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 ...
11
votes
2answers
1k 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 ...
10
votes
1answer
5k 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?
10
votes
3answers
2k 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 ...
10
votes
1answer
441 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? ...
9
votes
3answers
1k 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 ...
9
votes
4answers
7k 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 ...
9
votes
1answer
248 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 ...
9
votes
4answers
2k 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 ...
9
votes
3answers
2k views

How to recover deleted crontab

I was trying to edit crontab in the terminal, and I accidentally typed crontab -r instead of crontab -e. Who would figure such dangerous command would sit right next to the letter to edit the crontab? ...
9
votes
1answer
6k 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 ...
8
votes
1answer
5k 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 ...
8
votes
1answer
5k views

controlling priority of applications using cgroups

I would like to understand cgroups better and would like to understand the use-cases for applying cgroups. Are cgroups a good way for prioritizing different applications (i.e, giving higher priority ...
8
votes
2answers
14k views

Which process scheduler is my linux system using?

I'm not quite sure if stackoverflow or serverfault is the forum to use for this question, but ill try here. Is there some command I can use or a file I can check in order to find out which process ...
8
votes
2answers
9k 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?
8
votes
2answers
2k views

Using and understanding systemd scheduling-related options in a desktop context

In systemd service files, one can set the following scheduling related options (from the systemd.exec man page, correct me if I'm wrong): Nice Sets the default nice level (scheduling ...
7
votes
6answers
3k views

Can you make a linux system halt and boot my Raspberry-pi at certain times?

How to make a system turn itself off and back on at different times. For example I would have my "server" turn off at 4 A.M then turn back on at 5 A.M every day. Is this possible? I am using a ...
7
votes
4answers
480 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 <...
7
votes
2answers
5k views

PBS equivalent of 'top' command: avoid running 'qstat' repeatedly

When I run several jobs on a head node, I like to monitor the progress using the command top. However, when I'm using PBS to run several jobs on a cluster, top will of course not show these jobs, and ...
7
votes
3answers
5k views

How does Linux kernel find out which process to wake up during interrupt handling?

I was reading the book Linux Kernel Development on Chapter Process Scheduling. On Page 61, section Waking Up, the first paragraph reads: Waking is handled via wake_up(), which wakes up all the ...
7
votes
1answer
1k 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? two ...
7
votes
1answer
315 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
2answers
249 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
2answers
5k 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 ...
6
votes
1answer
680 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)?
6
votes
1answer
3k views

What is the recommended way of setting a default IO scheduler on Linux?

I would like deadline to be the default IO scheduler for my system, and I don't want to lose that config when I reboot. What is the proper way of doing that? (I'm using Debian) Some hints: have a ...
6
votes
1answer
64 views

Does linux stops processing related to GUI when we remove the desktop screen from connection from cabinet(CPU box)?

When there is big non interactive software running and if I required more processing power then, after removing the desktop screen does kernel stops processing related to GUI(graphical user interface) ...
6
votes
0answers
4k views

Does the timeslice depend on process priority or not under Completely Fair Scheduling?

I'm trying to understand the Completely Fair Scheduler (CFS). According to Robert Love in Linux Kernel Development, 3rd edition(italics his, bold mine): Rather than assign each process a timeslice,...
5
votes
2answers
2k 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 ...
5
votes
2answers
1k 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: $ @...
5
votes
2answers
14k views

How to install and use at job scheduling?

I am not clear on the following: Is the process for at available to all linux installations? Or do would I need to do something to "install" it?