Questions tagged [sleep]
a command for delaying execution of a program for the given length of time. For low power mode, use *suspend* instead.
10
questions
62
votes
3answers
167k views
How do I start a Cron job 1 min after @reboot?
I need my script to be executed a minute after each reboot. When I apply @reboot in my crontab it is too early for my script - I want the script to be executed after all other tasks that are routinely ...
23
votes
8answers
19k views
cron Vs. sleep - which is the better one in terms of efficient cpu/memory utilization?
The Case:
I need to run some commands/script at certain intervals of time and for this I have two options:
set up a cron-job
implement a loop with sleep in the script itself.
Question:
Which is the ...
8
votes
3answers
3k 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+...
18
votes
2answers
13k views
How to run systemd user service to trigger on sleep (aka. suspend, hibernate)?
Based on various sources I have cobbled together ~/.config/systemd/user/screenlock.service:
[Unit]
Description=Lock X session
Before=sleep.target
[Service]
Environment=DISPLAY=:0
ExecStart=/usr/bin/...
21
votes
8answers
25k views
Avoiding busy waiting in bash, without the sleep command
I know I can wait on a condition to become true in bash by doing:
while true; do
test_condition && break
sleep 1
done
But it creates 1 sub-process at each iteration (sleep). I could ...
23
votes
10answers
16k 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 "...
12
votes
6answers
2k 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 ...
12
votes
3answers
12k views
Sleep until next occurrence of specific time
I need a series of commands or a single command that sleeps until the next occurrence of a specific time like "4:00" occurs.
How would I do that?
The at command or a cronjob is not a option because ...
1
vote
3answers
826 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 ...
0
votes
1answer
2k 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 ...