0

I have 20 Ubuntu terminals that run RDP sessions from our RDS server (Server 2012R2).

I want to shut down these machines and night and start them up again in the morning remotely, preferably from the RDS server, but definitely from a Windows-based machine.

For startup, I can us WOL, so there's no issue there.

For shutdown, however, I'm stuck.

What is the best way to automate that shutdown process?

Batch file with Putty script? Third-party software? Native Batch file with Powershell? VNC tools?

I can't imagine this is an issue that hasn't already been dealt with, but I can't seem to find much documentation on it.

EDIT: Facepalming after someone mentioned cron. Definitely a fix for the immediate problem, but I'm still looking for something end-user friendly for the managers of these terminals who are familiar with a GUI interface. I'm thinking of something like Wyse Device Manager (http://www.dell.com/us/business/p/wyse-wdm/pd), but not tailored to that specific brand.

Craig
  • 141
  • 1
  • 1
  • 10
  • 2
    Why not set a cronjob? That would be the 'normal' way to have a *nix do something on a schedule. – Zoredache Apr 21 '16 at 21:13
  • I can't even tell you how stupid I feel for not thinking of cron. I got so caught up in higher-level functions/centralized run, etc. That's definitely the temporary fix. However, it would be nice to be do some things on demand, for example restart or shutdown a specific terminal from a server. I don't mind getting into the command line, but the end users who 'supervise' the terminals definitely wouldn't feel comfortable. – Craig Apr 22 '16 at 00:47

2 Answers2

3

If you need to initiate commands on your (Ubuntu) Linux machines orchestrated centrally from another host, the tool of choice is usually ssh. This is not all that different if your orchestrator host is a Windows machine.

Cygwin comes with OpenSSH's version of the client (and the server in the same package, but I certainly would recommend removing the server binaries, especially on a Remote Desktop Server) which can be used to run commands on remote hosts. For automation, you would need some kind of non-interactive authentication - RSA keys are a frequently used option due to the low-threshold setup and virtually no dependencies on central authentication infrastructure.

the-wabbit
  • 40,737
  • 13
  • 111
  • 174
  • I'll investigate Cygwin. It's not quite the answer I'm looking for, but it's a helpful pointer in the right direction. – Craig Apr 22 '16 at 00:50
1

I would use cron for this if you don't need to do this shutdown on demand, but rather according to a schedule. Use "poweroff" in your command line to shut the systems down and power them off.

Is there any harm to letting the systems just run?

ewwhite
  • 197,159
  • 92
  • 443
  • 809