Comments (8)
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.
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.
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.
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.
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.
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.
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.
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)
- API module to enable easier use of PSSH as a library (patch included)
- better detection of ssh yes/no questions HOT 1
- Use pssh as a module rather as a tool HOT 4
- Not allowing relative paths makes no sense HOT 3
- pslurp can't use rsync HOT 2
- Patch: pass -o SendEnv in a way that is friendly on Mac OS HOT 1
- How to distribute different files to different hosts? HOT 1
- motd being printed only on debian squeeze boxes HOT 4
- SIGINFO handler gives task status HOT 1
- Manpage name problem HOT 1
- Sudo requires allocation of a real pseudoterminal HOT 4
- Installation errors: "setup.py install" HOT 1
- pslurp multiple files HOT 1
- Bandwith limit with pscp (parallel scp) HOT 4
- Summary of failed and successful execution HOT 2
- Teardown code in test classes is never called
- IPv6 host address processing broken
- Allow '-' as an alias for stdin
- cannot parse for more than one -O/-o options; cannot use -i option
- Crash on Archlinux/Python3.4 when asking for password (Includes one line fix) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parallel-ssh.