Forum Discussion

doubtsreadyapi's avatar
doubtsreadyapi
Contributor
5 years ago

Using Ready APi How to SSH into remote servers and run commans

Using Ready APi How to SSH into remote servers and run commands   like purging the files, and purging backups in nfsshare
  • richie's avatar
    richie
    5 years ago
    Hey doubtsreadyapi,

    You can but it looks like youll need to download some .jars to support SSHing into your remote endpoint. Just plugging that code into a groovystep wont work on its own. There's an embedded link on the page that looks like it will help.

    However, i want to reiterate what i stated before. Relying on some other component in the jenkins pipeline thats more appropriate for the job would probably make it a lot easier. You could create a putty batch file to login via SSH and then truncate the relevant directory and this would be a LOT easier than trying to do the same thing via readyapi! (https://stackoverflow.com/questions/36979376/how-to-open-putty-using-batch-and-login-then-execute-list-of-commands-on-bash)

    Rich