how to specify to create log file silently without error or reuse log file without prompt in command line?...











up vote
-2
down vote

favorite












Expected:



I am trying connect to host using putty in windows command line to execute the list of commands in cmds.txt and save the logs in putty.log, where it has to be created if not exists or it has to be reused, without prompting:



"C:UsersUser1Desktopputty.exe" -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "C:UsersUser1Documentsputty.log" -m "C:UsersUser1Documentscmds.txt"


Actual:



But, it throws exception that file not exists or prompts for reusing the existing file!



In GUI, we can specify like “&H-&Y&M&D-&T.log” for unique session logs in session logging.



How to specify to create log file silently or reuse log file without prompt in command line?










share|improve this question















closed as off-topic by Romeo Ninov, roaima, G-Man, Rui F Ribeiro, JigglyNaga Nov 23 at 11:50



  • This question does not appear to be about Unix or Linux within the scope defined in the help center.

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 6




    I'm voting to close this question as off-topic because its about Windows software, not UNIX/Linux
    – Romeo Ninov
    Nov 23 at 7:39










  • @RomeoNinov Putty is available also on linux. In any case, I agree with you that this seems a windows oriented question.
    – andcoz
    Nov 23 at 11:21

















up vote
-2
down vote

favorite












Expected:



I am trying connect to host using putty in windows command line to execute the list of commands in cmds.txt and save the logs in putty.log, where it has to be created if not exists or it has to be reused, without prompting:



"C:UsersUser1Desktopputty.exe" -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "C:UsersUser1Documentsputty.log" -m "C:UsersUser1Documentscmds.txt"


Actual:



But, it throws exception that file not exists or prompts for reusing the existing file!



In GUI, we can specify like “&H-&Y&M&D-&T.log” for unique session logs in session logging.



How to specify to create log file silently or reuse log file without prompt in command line?










share|improve this question















closed as off-topic by Romeo Ninov, roaima, G-Man, Rui F Ribeiro, JigglyNaga Nov 23 at 11:50



  • This question does not appear to be about Unix or Linux within the scope defined in the help center.

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 6




    I'm voting to close this question as off-topic because its about Windows software, not UNIX/Linux
    – Romeo Ninov
    Nov 23 at 7:39










  • @RomeoNinov Putty is available also on linux. In any case, I agree with you that this seems a windows oriented question.
    – andcoz
    Nov 23 at 11:21















up vote
-2
down vote

favorite









up vote
-2
down vote

favorite











Expected:



I am trying connect to host using putty in windows command line to execute the list of commands in cmds.txt and save the logs in putty.log, where it has to be created if not exists or it has to be reused, without prompting:



"C:UsersUser1Desktopputty.exe" -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "C:UsersUser1Documentsputty.log" -m "C:UsersUser1Documentscmds.txt"


Actual:



But, it throws exception that file not exists or prompts for reusing the existing file!



In GUI, we can specify like “&H-&Y&M&D-&T.log” for unique session logs in session logging.



How to specify to create log file silently or reuse log file without prompt in command line?










share|improve this question















Expected:



I am trying connect to host using putty in windows command line to execute the list of commands in cmds.txt and save the logs in putty.log, where it has to be created if not exists or it has to be reused, without prompting:



"C:UsersUser1Desktopputty.exe" -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "C:UsersUser1Documentsputty.log" -m "C:UsersUser1Documentscmds.txt"


Actual:



But, it throws exception that file not exists or prompts for reusing the existing file!



In GUI, we can specify like “&H-&Y&M&D-&T.log” for unique session logs in session logging.



How to specify to create log file silently or reuse log file without prompt in command line?







ssh putty






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 at 11:05









Rui F Ribeiro

38.3k1475127




38.3k1475127










asked Nov 23 at 7:36









AVA

1134




1134




closed as off-topic by Romeo Ninov, roaima, G-Man, Rui F Ribeiro, JigglyNaga Nov 23 at 11:50



  • This question does not appear to be about Unix or Linux within the scope defined in the help center.

If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by Romeo Ninov, roaima, G-Man, Rui F Ribeiro, JigglyNaga Nov 23 at 11:50



  • This question does not appear to be about Unix or Linux within the scope defined in the help center.

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 6




    I'm voting to close this question as off-topic because its about Windows software, not UNIX/Linux
    – Romeo Ninov
    Nov 23 at 7:39










  • @RomeoNinov Putty is available also on linux. In any case, I agree with you that this seems a windows oriented question.
    – andcoz
    Nov 23 at 11:21
















  • 6




    I'm voting to close this question as off-topic because its about Windows software, not UNIX/Linux
    – Romeo Ninov
    Nov 23 at 7:39










  • @RomeoNinov Putty is available also on linux. In any case, I agree with you that this seems a windows oriented question.
    – andcoz
    Nov 23 at 11:21










6




6




I'm voting to close this question as off-topic because its about Windows software, not UNIX/Linux
– Romeo Ninov
Nov 23 at 7:39




I'm voting to close this question as off-topic because its about Windows software, not UNIX/Linux
– Romeo Ninov
Nov 23 at 7:39












@RomeoNinov Putty is available also on linux. In any case, I agree with you that this seems a windows oriented question.
– andcoz
Nov 23 at 11:21






@RomeoNinov Putty is available also on linux. In any case, I agree with you that this seems a windows oriented question.
– andcoz
Nov 23 at 11:21












1 Answer
1






active

oldest

votes

















up vote
0
down vote













According to man putty there is no option to force putty to reuse the log file.
Try one of these ideas:





  • You could remove the file before running putty.



    rm -f "~/Documents/putty.log"; putty -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "~/Documents/putty.log" -m "~/Documents/cmds.txt"



  • You could add a timestamp to the log file (this is a bash example).



    putty -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "~/Documents/putty-$(date +%s).log" -m "~/Documents/cmds.txt"







share|improve this answer




























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    According to man putty there is no option to force putty to reuse the log file.
    Try one of these ideas:





    • You could remove the file before running putty.



      rm -f "~/Documents/putty.log"; putty -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "~/Documents/putty.log" -m "~/Documents/cmds.txt"



    • You could add a timestamp to the log file (this is a bash example).



      putty -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "~/Documents/putty-$(date +%s).log" -m "~/Documents/cmds.txt"







    share|improve this answer

























      up vote
      0
      down vote













      According to man putty there is no option to force putty to reuse the log file.
      Try one of these ideas:





      • You could remove the file before running putty.



        rm -f "~/Documents/putty.log"; putty -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "~/Documents/putty.log" -m "~/Documents/cmds.txt"



      • You could add a timestamp to the log file (this is a bash example).



        putty -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "~/Documents/putty-$(date +%s).log" -m "~/Documents/cmds.txt"







      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        According to man putty there is no option to force putty to reuse the log file.
        Try one of these ideas:





        • You could remove the file before running putty.



          rm -f "~/Documents/putty.log"; putty -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "~/Documents/putty.log" -m "~/Documents/cmds.txt"



        • You could add a timestamp to the log file (this is a bash example).



          putty -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "~/Documents/putty-$(date +%s).log" -m "~/Documents/cmds.txt"







        share|improve this answer












        According to man putty there is no option to force putty to reuse the log file.
        Try one of these ideas:





        • You could remove the file before running putty.



          rm -f "~/Documents/putty.log"; putty -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "~/Documents/putty.log" -m "~/Documents/cmds.txt"



        • You could add a timestamp to the log file (this is a bash example).



          putty -ssh "10.10.10.10" -l "user1" -pw "passw0d" -sessionlog "~/Documents/putty-$(date +%s).log" -m "~/Documents/cmds.txt"








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 23 at 11:30









        andcoz

        12.3k33039




        12.3k33039















            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre