You can do this directly from the shutdown command, see man shutdown:
/sbin/shutdown [-akrhPHfFnc] [-t sec] time [warning message]
time When to shutdown.
So, for example:
shutdown -h 21:45
That will run shutdown -h at 21:45.
For commands that don't offer this functionality, you can try one of:
A. Using at
The at daemon is ...
You need to create two files: one for service, other for timer with same name.
after that reload the ...
One alternative is to not shutdown, but to hibernate or suspend the system and then automatically wake it up using rtcwake utility.
rtcwake -s 3600 -m disk
will immediately hibernate (suspend to disk) the system and resume it in 1 hour. Similarly
sleep 600; rtcwake -s 60 -m mem
will suspend to ram in 10 minutes from now, and then resume ...
The proportion of the processor time a particular process receives is determined by the relative difference in niceness between it and other runnable processes.
The Linux Completely Fair Scheduler (CFS) calculates a weight based on the niceness. The weight is roughly equivalent to 1024 / (1.25 ^ nice_value). As the nice value decreases the weight increases ...
No you can't specify a date at the shutdown command but two alternatives exist:
1) The easiest is to use the at command. The following example will execute shutdown +5 at a specific time and day:
echo "shutdown +5" | at 10:05am 2019-01-19
2) if you don't mind using you calculator and want to shutdown in say 24hours (24*60=1440 minutes) and you're ...
I'm not in Ubuntu, but what I did in Fedora may help you.
BFQ is a blk-mq (Multi-Queue Block IO Queueing Mechanism) scheduler, so you need to enable blk-mq at boot time, edit your /etc/default/grub file and add scsi_mod.use_blk_mq=1 to your GRUB_CMDLINE_LINUX, this is my grub file, as an example:
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /...
In the context of the Linux kernel, when people talk about pre-emption they often refer to the kernel’s ability to interrupt itself — essentially, switch tasks while running kernel code. Allowing this to happen is quite complex, which is probably the main reason it took a long time for the kernel to be made pre-emptible.
At first most kernel code couldn’t ...
It is possible for an user to use real time priority for a process as well. This configuration could be set from /etc/security/limits.conf file. I see the below contents in that file.
#Each line describes a limit for a user in the form:
#<domain> <type> <item> <value>
If we check ...
at executes any command that should have been executed before when you wake up the computer, but may take a few minutes to do that. It doesn't even matter whether you gave it a specific date, as you can test easily:
$ sudo date -s "2017-12-15 23:57:00"
$ at 23:59 17-12-15 <<<'echo executed >at_test'
job 1 at Fri Dec 15 23:59:00 2017
# suspend, ...
Check out the Wake-on-LAN (WoL) feature. Arch Linux has nice documentation on using it, and do not worry; it is Linux general. In Ubuntu you have the wakeonlan package to send magic packets to your machine. Here is Ubuntu documentation on using WoL.
So to turn your machine automatically, you will have to use another machine that will turn it on with WoL.
Here is another option without using your timer. If timing is not terribly critical and and script isn't long running it will be fine for simple things.
From man bash | less '+/^\s*CONDITIONAL'
True if file exists and has a size greater than zero.
To get the script to run at a pre-defined time, put your code into an executable scipt and load it into a cronjob.
I suspect you possibly could put your command into a one liner and load it into a crobtab? ( I would be interested to know if anyone ...
If a task is blocked, it waits for resources to become available again.
In your case there was propably either a IO-problem or a contention in the disk-area. Or your system-load was so high that there was not enough CPU-power available to finish the job in time.
I have seen this error from cron, if it tries to start a job in a very busy time.
Cron is used to schedule a job to run repeatedly. What you want is at, which schedules a job to run one-time. For your example you can write:
This will bring up an interactive prompt where you can enter /tmp/script.sh followed by Ctrl+D.
You can suspend or hibernate your system and then automatically wake it up with rtcwake command. For example to suspend (to ram) and resume in 60 seconds do
rtcwake -s 60 -m mem
To hibernate (suspend to disk) in one hour from now and resume in two hours:
sleep 3600; rtcwake -s 3600 -m disk
You can also wakeup the system at given time with -t option which ...
Preemptive kernel only means that there is no Big Kernel Lock.
Linux had preemptive multi-tasking (i.e. user code was preemptible) since its first moment (as far I know, the very-very first Linux 0.0.1 uploaded by Linus to the funet ftp server was already preemptive multitask). If you executed, for example, multiple compression or compilation processes, ...
Why not use watch to update qstat at a regular interval?
watch --interval=0.5 qstat will refresh the terminal with the output of qstat every 0.5 seconds. It doesn't quite satisfy your request of not running qstat repeatedly, but it's not manual at all.
qBittorrent does have scheduling!
However, it may or may not be sufficiently sophisticated for your needs.
Scheduling Global Changes in Limits for Specific Days/Times
Click Tools > Options.... Click the Speed tab on the left. At the bottom of the window you'll see options to set the upload and download rate limits for Alternative Global Rate Limits.
Depending on your Linux distribution and the kind of installation (minimal, desktop-centric, etc.) at (and atd the at job scheduler daemon) is installed by default or not.
To verify it you can issue commands like:
$ which at
$ which atd
$ yum whatprovides atd # to get the package name
$ yum info pkg-name # to see if it is ...
The shutdown command has already an embedded scheduler so you don't need a cron job for it to run at the specified time. In Linux as everywhere else, it's better to stick to the KISS principle (Keep It Short and Simple).
shutdown -h 22:00 will work fine, no need to run it in the background. Add the command at the end of /etc/rc.local (or /etc/rc.d/rc....
@hourly: Run once an hour, ie. "0 * * * *".
So it's strictly the same.
To run a job at a varying point in the hour (or multiple jobs, to spread the load) you can sleep for a random amount of time before starting the job:
@hourly sleep $((RANDOM / 10)); dowhatever
This sleeps for up to 3276 seconds (nearly an hour), then runs the ...
I found this Q&A over on StackOverflow titled: How does cron internally schedule jobs?.
excerpt from that post & the wikipedia article on cron
The algorithm used by this cron is as follows:
1. On start-up, look for a file named .crontab in the home directories of
all account holders.
2. For each crontab file found, determine the next time in ...
You should be able to do this with a mains timer between the mains outlet and the power supply.
Shut down the Raspberry at 4 A.M using a cron job, then set the timer to cut the mains a bit later and to restore power at 5 A.M.
To stop a service A with a timer, you can create a service B of type oneshot that it will be in conflict with, then use a timer to start the service B.
If a unit has a Conflicts= setting on another unit, starting the former will stop the latter and vice versa. (source)
Description=B service ...
The Linux timer interrupt handler doesn’t do all that much directly. For x86, you’ll find the default PIT/HPET timer interrupt handler in arch/x86/kernel/time.c:
static irqreturn_t timer_interrupt(int irq, void *dev_id)
This calls the event handler for global clock ...
This is 100% normal with respect to threading on any and all operating systems. The documentation for your thread library, any examples and tutorials you may find, etc. are likely to make a point of this as it is often confusing to people when they are learning the ropes of threading.
Threads are by default (and by definition) not synchronized.
This means ...
To list all crons for the given user.
crontab -u username -l;
To list all crons for all users
Run it as a super user
#List all cron jobs for all users
for user in `cat /etc/passwd | cut -d":" -f1`;
crontab -l -u $user;
You can get it to turn off whenever you like with halt or shutdown now or whatever you prefer; schedule that with cron or a custom sleeping background process.
In addition to the real time wakeup implemented by normal PC hardware (which the pi isn't) and usable via rtcwake, there is wake-on-LAN.
Unfortunately, neither of those will work on the raspberry pi,...