khrpcek / sshdo

Apache License 2.0
2 stars 1 forks source link

sshdo fails if run twice in the same minute #2

Closed jimneumann closed 9 years ago

jimneumann commented 9 years ago

me@box1:~/sshdo# ./sshdo.py Servers: boxen.txt Command: service nagios-nrpe-server restart Traceback (most recent call last): File "./sshdo.py", line 26, in print sshdo() File "/home/me/sshdo/sshdef.py", line 52, in sshdo if not os.path.exists('logs'+datetime): os.makedirs('logs/'+datetime) File "/usr/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 17] File exists: 'logs/05022015-0116'

khrpcek commented 9 years ago

I added seconds to the log file names so that it can be run multiple times per minute without falling over its own log files.