Questions tagged [async]

18 questions
175
votes
7 answers

Can I watch the progress of a `sync` operation?

I've copied a large file to a USB disk mounted on a Linux system with async. This returns to a command prompt relatively quickly, but when I type sync, of course, it all has to go to disk, and that takes a long time. I understand that it's going to…
mattdm
  • 39,535
  • 18
  • 99
  • 133
12
votes
1 answer

Save cursor position and restore it in terminal

I am playing with some terminal capabilities to create async prompt output on bash. I want to get something like this: while outputting string in PROMPT_COMMAND, save terminal cursor position, print put ... and go do other stuff (printing other info…
Lapshin Dmitry
  • 323
  • 2
  • 13
4
votes
1 answer

How to set interval for an asynchronous command in bash?

I'm trying to achieve this while condition; do var=value1 ### update value every 5s while sleep 5; do var=value2 done ### ... [ rest of code ] done The problem here is that the script will always enter the loop and block the rest of the code
Belka h.j
  • 55
  • 4
4
votes
1 answer

To sync or not to sync in an embedded environment?

I have a single board appliance that runs Debian 10 on a chunk of flash. UBIFS is used, and is split into two volumes: an ro roots, and an rw /var. I have found that under power cycling/reset conditions, that I can end up with 0 byte files. I keep…
Travis Griggs
  • 1,461
  • 3
  • 14
  • 21
4
votes
1 answer

Populate PS1 asynchronously

I have a few git svn related functions that see if I have to pull/push from/to the repository. My problem is that the functions I've written to gather this information are too slow. I'd like to make them async so that PS1 shows a default, if though…
3
votes
2 answers

How to attach a listener to sysfs files?

How to watch for sysfs file changes (like /sys/class/net/eth0/statistics/operstate) and execute a command on content change? inotify does not work on sysfs I don't want to poll. I want to set a listener with a callback routine once
Zeta.Investigator
  • 880
  • 1
  • 7
  • 25
3
votes
2 answers

Stopping an asynchronous while loop in a shell script

I have a asynchronous while loop that restarts processes until some condition is met. This look something like this: (while [ "$check_condition" -eq 1 ]; do ./async_command done) & ... # do some stuff check_condition=0 pkill -9…
N. Krh
  • 33
  • 6
3
votes
1 answer

Why does io_uring have a layer of indirection for the submission queue?

From the paper on io_uring, the submission ring contains indices into a submission array, where the submission event itself is stored. The documentation explains this layer of indirection as follows: One important difference is that while the CQ…
3
votes
1 answer

Messages on new terminal after using nohup

I'm trying to run a few commands asynchronously on a login script (.bash_profile). When I open a new terminal, I see messages like this. They also show up when I log onto a system over SSH. Last login: Sat Jun 11 19:21:44 on ttys001 [1]- Exit 127 …
user56041
2
votes
1 answer

What does "asynchronous" mean in these cases?

I have asked what "asynchronous" means a while ago for interrupts. Now I have the same question but for running shell commands and for cancelling threads. From Bash manual If a command is terminated by the control operator &, the shell executes the…
Tim
  • 98,580
  • 191
  • 570
  • 977
2
votes
1 answer

Set a callback for when a certain process is spawned

The script I'm writing launches process A, which after an uncertain amount of time, launches a child process B. I need the script to execute a command C which depends on process B. But B might not be there at call time! How to wait until a process…
deprecated
  • 2,841
  • 4
  • 24
  • 22
1
vote
1 answer

Curl returning with no response and does not wait for `wait=x seconds`

I call an async service that takes ~80 seconds to respond. I run: curl -v -X POST https://hostname.com/service/v2/predict \ -H 'x-api-key: somekey' \ -H 'x-request-id: longfiles' \ -H "Authorization: Bearer dfv651df8fdvd" \ -H 'Prefer:…
Franck Dernoncourt
  • 4,749
  • 15
  • 48
  • 79
1
vote
1 answer

Enabling Asynchronous IO at HP-UX Operating System

We are using HP-UX Itanium version B.11.31 and this server is used for running Sybase database version ASE15.7. I would like to know how to enable Asynchronous IO at Operating System level. I went through Sybase ASE and their suggestion is provided…
1
vote
2 answers

run script asynchronously / in a different process

I have a simple php script
0
votes
1 answer

Asynchronous downloading from virtual machine?

I have some files stored on a virtual machine that I'm downloading onto my PC. There are approximately 1 million files and I have been using the following command: scp vm_user@IP:/home/vm_user/path_to_files /Users/documents As you can imagine,…
dollar bill
  • 111
  • 3
1
2