Hi Daniel,

Yes 'environment' refers to policies. Saving a key should be acceptable. 
I'll give that a go, thanks.  Re. creating a job to do this, I'll try that, 
but I suspect that the safe-restart waits for no jobs to be running (that's 
the whole point of it after all), so issuing from a job might not work.

Thanks
Andy

On Thursday, 27 February 2014 10:39:45 UTC, Daniel Beck wrote:
>
> You can also use an SSH key for authentication with jenkins-cli.jar 
> (configure the key in the Jenkins user configuration), so if "environment" 
> refers to non-technical reasons, that would be an option. 
>
> Then there's the REST API. POST to /safeRestart to perform that action. 
> For authentication, use the API key of the user account in Jenkins instead 
> of a password. 
>
> If you use the Groovy plugin, you could create a job that performs 
> safeRestart in a System Groovy build step with 
> 'jenkins.model.Jenkins.instance.safeRestart()'. Schedule as you would any 
> other job. 
>
> On 27.02.2014, at 11:18, AndyB <[email protected] <javascript:>> wrote: 
>
> > Hi, 
> > 
> > Could you tell me if it's possible to schedule a regular safe-restart of 
> Jenkins? I have the safe-restart plugin which works fine, but I'd like to 
> have Jenkins do a safe-restart over the weekend when it's generally idle. I 
> looked at the command line interface but I can't use that as it requires 
> either storing a password in a file or passing a password on the command 
> line, neither of which is doable in our environment. Is there a way to 
> schedule an automatic safe restart from within Jenkins? I guess the problem 
> is that if it's a job the restart will block 'til the job itself is 
> completed, causing a deadlock. Can anyone suggest a way to achieve this? 
> > 
> > Thanks, 
> > Andy 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Jenkins Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected] <javascript:>. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to