Producing comprehensible logs for shell script ran through xargs

Alpha_Omega

I am currently reindexing Elasticsearch indices in a shell script using curl to do REST API calls.

To improve performance, I am running this script with xargs over 10 processes.

However, all of my scripts are outputting into a single log, making this log useless/incomprehensible, since output is being written async which makes the log unordered.

The client would like to know progress made on reindexing by looking at logs (i.e they want to know if 50/100 index is done when they look at the log). And we would like to have the curl outputs etc for debugging purposes.

What are some ways I can make comprehensible logs?

N. Kern

You could try specifying a separate log file for each process, then concatenating the logs at the end.

But if you really want them all to access the same logfile, then I'm afraid your only way to do that is with a lock, which is not easy with bash/xargs.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Python - Activate conda env through shell script

From Dev

To run unix shell script through JAVA applications

From Dev

How to execute the vim commands through shell script

From Dev

exit or close the vim through shell script

From Dev

Trying to send an email through a groovy shell script

From Dev

Where are python logs default stored when ran through IPython notebook?

From Dev

Accessing Oozie JMS notification through shell script

From Dev

how to force the control c within the shell script the shell script has ran,

From Dev

Shell script through Oozie

From Dev

SMB Client Commands Through Shell Script

From Dev

Errors when I start the Python shell, errors from a script I ran a week ago

From Dev

navigate through folders using shell script

From Dev

How to redirect shell script output ran from a python script

From Dev

looping through JSON array in shell script

From Dev

Python - Activate conda env through shell script

From Dev

How to run a shell script through apache airflow

From Dev

check if script ran successfully?

From Dev

running hbase shell command through shell script

From Dev

Why is curl not producing output when run in a shell script from cron?

From Dev

FTP "put" not copying file to remote host when ran from shell script but copies the file to remote host when ran manually

From Dev

Errors when I start the Python shell, errors from a script I ran a week ago

From Dev

Script that scans through logs, pulls specific data, and creates an output directory

From Dev

Pass A File Through Shell Script

From Dev

Shell script to grep multiple occurrence of a word in logs

From Dev

Command works in script (or -c), but not when ran directly (in an interactive shell)

From Dev

How to redirect shell script output ran from a python script

From Dev

Print console logs of a shell script

From Dev

grep for lines in shell script, send to xargs with $1 set

From Dev

query errors out if ran from shell script

Related Related

  1. 1

    Python - Activate conda env through shell script

  2. 2

    To run unix shell script through JAVA applications

  3. 3

    How to execute the vim commands through shell script

  4. 4

    exit or close the vim through shell script

  5. 5

    Trying to send an email through a groovy shell script

  6. 6

    Where are python logs default stored when ran through IPython notebook?

  7. 7

    Accessing Oozie JMS notification through shell script

  8. 8

    how to force the control c within the shell script the shell script has ran,

  9. 9

    Shell script through Oozie

  10. 10

    SMB Client Commands Through Shell Script

  11. 11

    Errors when I start the Python shell, errors from a script I ran a week ago

  12. 12

    navigate through folders using shell script

  13. 13

    How to redirect shell script output ran from a python script

  14. 14

    looping through JSON array in shell script

  15. 15

    Python - Activate conda env through shell script

  16. 16

    How to run a shell script through apache airflow

  17. 17

    check if script ran successfully?

  18. 18

    running hbase shell command through shell script

  19. 19

    Why is curl not producing output when run in a shell script from cron?

  20. 20

    FTP "put" not copying file to remote host when ran from shell script but copies the file to remote host when ran manually

  21. 21

    Errors when I start the Python shell, errors from a script I ran a week ago

  22. 22

    Script that scans through logs, pulls specific data, and creates an output directory

  23. 23

    Pass A File Through Shell Script

  24. 24

    Shell script to grep multiple occurrence of a word in logs

  25. 25

    Command works in script (or -c), but not when ran directly (in an interactive shell)

  26. 26

    How to redirect shell script output ran from a python script

  27. 27

    Print console logs of a shell script

  28. 28

    grep for lines in shell script, send to xargs with $1 set

  29. 29

    query errors out if ran from shell script

HotTag

Archive