GithubHelp home page GithubHelp logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 6, 2024
Sorry for the late response.  This sounds like a nice feature, but 
unfortunately, it probably won't be highest priority.  If you include a patch, 
it will definitely go more quickly.  Anyway, this does sound like a very handy 
feature.  Thanks for posting the request.

Original comment by [email protected] on 9 Jan 2011 at 6:18

  • Changed title: output filename format
  • Added labels: Priority-Low, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect

from parallel-ssh.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 6, 2024
All that would be needed is the ability to substitute %h (for example) in a 
format string.  Everything else can be accomplished with the shell's process 
substitution: I.e.

Imagine %h gets substituted by the hostname:

--stdout-filespec "./stdout/$(date +%Y%m%d)/%h.txt"

I attach a quick'n'dirty patch that achieves this

# directories have to exist with this patch
mkdir dir
./bin/pssh -o "dir/file_%h_$(date +%Y%m%d)_stdout" -e "dir/file_%h_$(date 
+%Y%m%d)_stderr" -h list hostname

ls dir
file_h1_20110902_stderr
file_h2_20110902_stdout
[..etc..]

Original comment by [email protected] on 2 Sep 2011 at 11:57

  • Added labels: ****
  • Removed labels: ****

Attachments:

from parallel-ssh.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 6, 2024
Thanks for sharing the patch. I'll take a look at it soon.

Original comment by [email protected] on 5 Sep 2011 at 2:25

  • Changed title: output filename format (patch available)
  • Added labels: ****
  • Removed labels: ****

from parallel-ssh.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 6, 2024
just a bit curious where this is at.....

Original comment by [email protected] on 11 Jan 2013 at 6:06

  • Added labels: ****
  • Removed labels: ****

from parallel-ssh.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 6, 2024
jcpunk, thanks for the reminder. I think it's a fantastic idea. A few issues 
that we should address before implementing this:

1) There needs to be an escape sequence. For example, the FORMAT spec detailed 
in the man page for date includes "%%" for allowing a literal "%" character.

2) There are probably some other types of information that would be useful to 
include, and it would be nice to explore some of the possibilities before 
implementing.

3) The way that stdout files are currently created, the first time a host "xyz" 
appears, the file is named "xyz", and if it's listed a second time in the hosts 
list, then a "xyz.1" file will be created, etc. The issue of hosts occurring 
multiple times should be addressed.

Anyway, I think this is a very desirable feature.

Original comment by [email protected] on 14 Jan 2013 at 4:38

  • Added labels: ****
  • Removed labels: ****

from parallel-ssh.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 6, 2024
I was thinking about how to transform the patch to meet these suggestions and 
ran into an odd outcome.

Don't want to radically alter the behaviour of -e or -o as that breaks 
backwards compatibility for this specialized feature.

So, what would a sensible command line argument look like?

Upon further reflection I'm thinking a simpler way to achieve the end result of 
the initial request might be a non-pssh solution.

Am I headed in the right direction?

pssh -o "$(date +%Y%m%d)_stdout" -e "$(date +%Y%m%d)_stderr" -h list 'uname -r' 

The end logs are in a uniquely-ish named dir and subsequent runs do not 
eliminate existing logs.

Logs for a given day are automatically stored in the directory and parse-able.  
Native OS tools could be used to rename them to any format desired.

For my use case this is a sufficient solution.

Original comment by [email protected] on 14 Jan 2013 at 6:01

  • Added labels: ****
  • Removed labels: ****

from parallel-ssh.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 6, 2024
It wasn't too hard to add a way of simply munging the output names if that 
proves valuable.

As an aside a workable regex for leaving %% alone while matching %h is

re.sub('[^%]%h', 'hostname', string)

Original comment by [email protected] on 14 Jan 2013 at 6:02

  • Added labels: ****
  • Removed labels: ****

Attachments:

from parallel-ssh.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 6, 2024
As you suggested, for just changing the names of the directories, something 
like `pssh -o "$(date +%Y%m%d)_stdout" -e "$(date +%Y%m%d)_stderr" -h list 
'uname -r'` works great. This is what I've personally done in the past, and 
maybe that's the best way to do it. Having a full format spec language might be 
useful if there are more types of information that would be useful to include, 
beyond just the hostname and date.

Original comment by [email protected] on 14 Jan 2013 at 6:53

  • Added labels: ****
  • Removed labels: ****

from parallel-ssh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.