Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sleep]

a command for delaying execution of a program for the given length of time. For low power mode, use *suspend* instead.

0
votes
1answer
18 views

Not able to hibernate or suspend centos system

I am running Centos 7 and all I want to do is make my computer go to sleep immediately. There is a setting I have set to make my computer go to sleep but only after a certain amount of inactivity but ...
0
votes
2answers
46 views

bash remove members Slack from channels using xargs and sleep?

I'd like to be able to remove a batch of people from a "private" Slack channel. Use case: whoops, I just added 137 people to the wrong channel! The Slack Member ID list is obtained from an Airtable ...
2
votes
0answers
33 views

Suspend delayed after lid close

For some reason, when I close my laptop lid, it takes my system 25 seconds to sleep. This is without any autolock prorams (xss-lock, xautolock, etc.) running. In my journalctl I can see exactly a 25 ...
1
vote
1answer
134 views

Can't suspend Debian machine: wakes up immediately after sleep (“PM: Device usb1 failed to suspend async”)

Since I installed the latest Debian updates yesterday (udev, systemd, ...) I can't put my Debian 9/KDE machine to sleep. It wakes up immediately after suspending (systemctl suspend). /var/log/syslog ...
4
votes
3answers
285 views

Terminate BASH For loop, that contains long sleep and other stuff, using any specific key

I have a bash script that has a for loop that iterates a lot of times and sleeps between iterations, potentially for a long time. It then writes results to a file, then terminates. On occasion I ...
3
votes
2answers
194 views

How to quit command prompt after a sleeping command executes?

I have a simple script: f=1 # initial value loop(){ ... if [[ $f -eq 1 ]] then echo $msg1 f=2 (sleep $interval; loop) & exit 1 elif [[ $f -eq 2 ]] ...
1
vote
2answers
85 views

Sleep certain sections of the script

I want to pause/sleep the elif part but keep the other elif parts working . I don't want the whole script to sleep if 1 sensor goes off. #!/bin/sh while true; do valid="" scan=`./script` ...
0
votes
0answers
23 views

How to determine if guest OS is suspended when running as virtual machine

Running CentOS 7 and in need to do some network related commands when suspended and resumed by the VMWare. Thus far all the solutions I have seen, is connected to pm-utils. But nothing appears to ...
0
votes
0answers
1k views

gdm3: Failed to parse options: Unknown option -reset (Ubuntu 18.04)

I'm having the same issue as described here: my computer won't wake up after I lock the screen or put it to sleep. One of the answers suggests running sudo gdm3 -reset, which I tried. But just as some ...
21
votes
10answers
6k views

Shell: is it possible to delay a command without using `sleep`?

Are there any substitutes, alternatives or bash tricks for delaying commands without using sleep? For example, performing the below command without actually using sleep: $ sleep 10 && echo "...
3
votes
3answers
520 views

sleep, wait and Ctrl+C propagation

If I have the following shell script sleep 30s And I hit Ctrl+C when the shell script is running, the sleep dies with it. If I have the following shell script sleep 30s & wait And I hit Ctrl+...
0
votes
0answers
18 views

bad font in openbox after resume

I've got openbox installed on my laptop on a Ubuntu 16.04 base and it works great. Only at times, after I resume from sleep, my system fonts are messed up and they won't come back until I restart ...
33
votes
6answers
7k views

Running a loop precisely once per second

I'm running this loop to check and print some things every second. However, because the calculations take maybe a few hundred milliseconds, the printed time sometimes skip a second. Is there any way ...
0
votes
1answer
42 views

What does `sleep` with multiple arguments mean?

I was wondering what differences are between sleep 1 2 3 and sleep 6 ? They seem the same. Thanks.
-3
votes
1answer
22 views

Differencess in process tree after stop session for few mins [closed]

Stop executing session for 3 mins with the sleep command and show differences in the process tree (with + symbol for new processes and - symbol for those which are gone). How to write a script for ...
2
votes
1answer
56 views

Prevent battery drain from constant write IO churn by browsers

For some reason, common browsers (Chromium is particularly bad, but Firefox isn't much better) generate constant IO load, particularly writes, on my Debian system. This is the case even when the ...
12
votes
9answers
28k views

Ubuntu 18.04 won't wake after screen lock and blank / suspend / sleep

I am trying to run Ubuntu 18.04 on a laptop with an AMD A12 processor and Radeon R7 graphics. I am having nothing but problems and am very discouraged with Ubuntu though I used 12.04 for years without ...
1
vote
1answer
502 views

Bash script not sleeping when running scripts in parallel

I have several bash scripts that I need to run in parallel. However, they are memory hogs so I would like to stagger each of them by 30 seconds but still run in parallel. For example: hourr=($(seq 0 ...
1
vote
0answers
140 views

system does not sleep and does not wake up

I recently bought a new HP ENVY x360 with AMD Ryzen 5 2500U CPU. So many driver support problems on Linux. I tried lots of distributions but none works. The main problem is that the laptop won't ...
3
votes
0answers
85 views

zfs pool not available on boot after setting noatime and drive idle times with hd-idle / hdparm

At first, I set up my RHEL7-x64 to sleep the zfs drives using this,this, and this. I believe I tried hd-idle first, when the problems began. I had written a script idle_drives_enable to handle ...
0
votes
2answers
126 views

MSI B150M Pro-VD mobo hangs on suspend in Linux Mint

I can't restore my Linux Mint 18.3, (Kernel v4.13.0-32-generic x86_64 running on a MSI B150M PRO-VD (MS-7996) v1.0 mobo), from sleep mode. Last messages on screen (at same second): [19.....] ...
-1
votes
1answer
360 views

Sometimes it's convenient to use ` read -t 3 ` instead of ` sleep 3 `. How do I make it work with `nohup`?

Sometimes it's convenient to use read -t 3 instead of sleep 3. How do I make it work with nohup? nohup bash -c ' date; read -t 3; date ' | tail -n 2 nohup.out As you can see, read -t 3 does not wait ...
1
vote
1answer
192 views

Slackware 14.2 - black screen after waking from sleep/lock - what process controls sleep/lock?

I have had Slackware 14.2 32bit installed on a netbook with LXDE as my main DE for about a month now. My main issue is that sometimes the screen is black on waking from sleep [suspend] and the only ...
2
votes
1answer
192 views

Bash `sleep` outputs __bp_preexec_invoke_exec

Background I'm running a larger one-line command. It is unexpectedly outputting (twice per iteration) the following: __bp_preexec_invoke_exec "$_" Here is the pared down command (removed other ...
1
vote
1answer
634 views

Sleep shortcut command lubuntu?

I'm trying to set the Sleep Button to actually put the computer to sleep and toggle my screensaver but to make this happen I have to have a terminal command to bind to the sleep button. So by going to ...
12
votes
6answers
1k views

at some time from now do something (and maybe also show result in console)

I use Ubuntu server 16.04 and I desire to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from ...
2
votes
0answers
408 views

How to run a script on resume to restart the audio drivers?

I'm currently running "Linux grant-N501VW 4.10.0-40-generic #44-Ubuntu SMP Thu Nov 9 14:49:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux" and I always get white noise through the headphones after ...
6
votes
0answers
60 views

why is `reset` so much slower than `tput reset`? [duplicate]

In all terminals I can think of, tput reset is much faster than reset, why? (sh, bash, xfce4-terminal, lxde-terminal, gnome-terminal, and probably others) I know the technical reason, reset issues a ...
1
vote
1answer
75 views

Echo something in background but see it even if you rebooted or had a power cut?

I use Ubutu server 16 .04 and I desire to echo something in the foreground, 2 days ahead, with sleep in the background. I assume the code I need is similar to the one below (which does both actions ...
0
votes
1answer
241 views

Echo something from a tmux session to base session

I have a script with this code: #!/bin/bash tmux new-session -d bash sleep 1d echo 1 day passed tmux kill-session AFAIU, the echo will appear after 24 hours in the tmux session's stdout ...
0
votes
0answers
474 views

keep CentOS 7 from sleeping

Several CentOS 7 servers recently went to sleep when their internet connection went down. They are all connected to a local network, and the connection between the outside internet and the local ...
0
votes
2answers
95 views

Unix Memory Question while sleep in background

I work in a Linux server which doesn't allow me to use cron. So, to bypass this, I write scripts that needs to run on a definitive time like this: while true do ... ... sleep 1d #changes ...
0
votes
1answer
611 views

Linux sometimes hangs when it attempts to go into sleep/suspend

Sometimes my PC (Linux Mint 18.1) hangs when it tries to go into sleep/suspend by itself after inactivity. When I come back to it, the monitor is in standby but the computer is still running (fans and ...
0
votes
1answer
163 views

polling process by kill -0 frequently

The following script in Linux prints "sleep 1 finished", but in general POSIX you can not use sleep 0.1, since the argument has to be integer. If I leave the command out, the script will never exit (...
2
votes
1answer
405 views

How do I check if the system is currently suspended?

I want to use my orange pi power button to suspend and resume system and have some troubles with check state. So I wrote shell script for this but it won't work; it's only suspending. When I click ...
2
votes
1answer
421 views

Understanding ACPI wake-up codes / DSDT (Differentiated System Description Table) of Thinkpad T430s BIOS [duplicate]

I'd like to trim wakeup events of my laptop. Could someone please explain me these 4 letter codes - which devices do they actually represent? $ cat /proc/acpi/wakeup Device S-state Status Sysfs ...
0
votes
1answer
735 views

What does “/bin/sh -c nice run-parts --report /etc/cron.daily” mean?

Today, when I logged in and checked the ps output, I noticed a few lines that were run automatically under the root. I grepped the relevant lines here: root 1126 0.0 0.0 2616 424 ? ...
2
votes
1answer
48 views

Schedule cancellable script to run after duration

I want to be able to run a script after a certain duration has elapsed. I also want to be able to cancel it and reschedule it, i.e. increase the duration on-the-fly. I was thinking of somthing like ...
0
votes
1answer
294 views

How do I know which sleeping jobs are safe to `kill`?

I work on a linux machine connected to a cluster. If I do top on a terminal, I see many (~200) sleeping processes. Probably they were caused by me by inappropriately Ctrl+C-ing those processes. How ...
1
vote
2answers
86 views

Testing CPU intensity of a single command or function

Is there a command that's useful for doing a benchmark test on a separate command or function; to see how cpu intensive it is? Preferably something similar to how you can report the duration of a ...
4
votes
1answer
334 views

Will this command run if connection to the remote server is lost?

If I run a command like this on my remote server: $ sleep 3h ; date ; nohup long-running-process ; date ... and the connection is lost after 2 hours, will the full command be executed? And if not, ...
0
votes
2answers
1k views

Sleep command to run after exactly every one hour

I need your small help, i have one script which i can not schedule on crontab. But I am using sleep command. I am facing issue while using sleep command. My script took 10 or 15 min to complete ( ...
0
votes
3answers
870 views

Break infinite 'while' loop on FreeBSD

I have a barebones FreeBSD system with only a terminal. I would like to monitor zpool status every 15 seconds or so. Usually on "regular" systems I would use watch -n15 but this is not available here. ...
1
vote
0answers
334 views

hdparm -S60 /dev/sda (Works fine, but every 30 mins HDD wakes up and spins down even though not in use.)

Seagate 4TB 3.5". $ hdparm -S60 /dev/sda OK. 5 mins after no access on HDD, it spins down. No problem. But every 30 mins it wakes up by itself without any event, and goes to bed immediately. I ...
12
votes
4answers
2k views

How to determine the amount of time left in a “sleep”?

I have: sleep 210m && for i in $(seq 1 5); do echo -e '\a'; sleep 0.5; done running as a simple, no-frills timer to remind me when something should be done. That sleep 210m is PID 25347. I'...
0
votes
1answer
494 views

`ssh […] sleep 3` (with sshpass) don't close ever

I open an SSH tunnel programatically, with: sshpass -p "my_password" ssh -fN -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes remote_user@remote_server.tld -L 13306:127.0.0.1:3306 sleep 3 and ...
3
votes
1answer
531 views

How do I find out which application is disabling sleep?

Sometimes when I try to suspend my laptop (using the sleep keyboard button), I get this popup from xfce4-power-manager: "Are you sure you want to hibernate the system? An application is currently ...
1
vote
3answers
375 views

How to Distribute Computing of `tar czf` for Longer Time?

My systems go under heavy load when I run sudo tar czf /media/masi/ntfsDisc/backup_home.tar.gz $HOME/ Fans goes to max etc. I would like to find a better balance between computing and power ...
1
vote
0answers
81 views

Check if laptop is asleep

Does anyone know to check via SSH or bash script whether or not my laptop has "fallen asleep". For some reason whenever my laptop falls asleep my drawings (on /dev/fb0) are over ridden by the ...
1
vote
0answers
164 views

Ubuntu VPS in sleep mode / standby?

I currently have a problem with my VPS (ubuntu 14.04.4). When I access it after hours the first time again via HTTP or SSH it takes a few seconds until it reacts, sometimes it is even too long, so it ...