CLONE(8)

πŸ’– CLONE πŸ’–

okay bestie, listen up β€” this is the clone driver from the NUT (Network UPS Tools) manual, section 8. she clones an UPS and treats its outlet as if it were a whole entire UPS, shutdown INSTCMD support included. iconic behavior honestly.


✨ NAME ✨

clone β€” Clone an UPS, treating its outlet as if it were an UPS (with shutdown INSTCMD support)


🌸 SYNOPSIS 🌸

clone -h

clone -a UPS_NAME [OPTIONS]
πŸ“ Note: this man page only spills the tea on the specific features of the clone driver. For all the core driver lore, go read nutupsdrv(8).

πŸ¦‹ DESCRIPTION πŸ¦‹

so. this driver sits on top of another driver's local UNIX socket file (or a Windows named pipe if that's your vibe), and it lets users group clients onto one particular outlet of a device and then deal with that outlet as if it were a totally normal UPS. main character energy tbh.

Unlike clone-outlet(8), this driver represents a manageable device β€” so it works both for monitoring and for client computer and UPS/ePDU outlet shutdowns (it supports sending relevant instant commands during run time). πŸ’…

Unlike dummy-ups(8), this driver does not need a running upsd data server, and it doesn't use the networked NUT protocol to talk to the "real" driver (which might be remote in the case of dummy-ups repeater mode). no cap.

This driver does not create a completely new virtual device β€” instead it replaces or extends some of the original readings reported by the "real" driver using info from the specified outlet, and relays all the other readings as they were. like a glow-up, not a whole new person.

Remote clients like upsmon can MONITOR the device entry presented by the data server with this driver (and the "real" driver) running and published. 🫢

A larger deployment with one or more lower-priority devices collected on a manageable outlet of an UPS or ePDU would likely see several drivers set up on the system that are actually capable of interacting with the UPS and running the NUT data server upsd(8) (and likely powered by another outlet):

  • a "real" driver talking to the UPS;
  • a clone driver talking to the "real" driver and issuing outlet power-off (or power-cycle) based on relatively high thresholds for remaining battery charge and/or runtime of the actual UPS (or explicit instant commands), with such operations first setting the respective timers for the outlet on the "real" driver, and the "FSD" flag among states of the virtual UPS status;
  • possibly a clone-outlet driver which is read-only and interprets the outlet timer values as triggers for "FSD" or "OFF" flags reported among states of the virtual UPS status.

With this approach, the lower-priority systems collected on such an outlet would run the NUT upsmon(8) client to MONITOR the virtual UPS presented by the read-only clone-outlet driver, and shut down as soon as the "FSD" flag is raised (fairly early, based on charge and/or runtime thresholds configured for that driver), allowing the higher-priority devices (likely including the NUT server) to enjoy a longer on-battery life. πŸ’–

The clone driver responsible for outlet power state changes would not normally be monitored directly (e.g. to avoid unfortunate direct shutdown requests from those clients), although it can be β€” instead of clone-outlet β€” in sufficiently trusted networks. πŸ”’


πŸŽ€ EXTRA ARGUMENTS πŸŽ€

This driver supports the following settings:

  • port=drivername-devicename β€” Required. This is the standard NUT driver port setting, and here it provides the name of the local Unix socket file (or Windows named pipe) used to connect to the "real" device driver.
  • load.off=command β€” Recommended. Sets the command on the "real" UPS driver that will be used to switch the outlet off. You need both load.off and load.on in order to power cycle the outlet. Otherwise, shutting down the clients powered by an outlet is a one way street (see IMPORTANT, bestie, don't skip it 😭).
  • load.on=command β€” Recommended. Sets the command on the "real" UPS driver that will be used to switch the outlet on. You need both load.off and load.on in order to power cycle the outlet. Otherwise, shutting down the clients powered by an outlet is a one way street (see IMPORTANT).
  • load.status=value β€” Recommended. Sets the variable on the "real" UPS driver that will be used to indicate the outlet status (i.e. on/off). If not specified, the clone driver will attempt to keep track of the outlet status, but this is less reliable. πŸ™ˆ
  • offdelay=num β€” Set the timer (in seconds) before the outlet is turned off after the shutdown condition (OB LB) for this outlet is met, or a command to shutdown was issued. Defaults to 120 seconds.
  • ondelay=num β€” Set the timer (in seconds) for the outlet to switch on in case the power returns after the outlet has been switched off. Defaults to 30 seconds.
  • mincharge=value β€” Set the remaining battery level when the clone UPS switches to LB (percent).
  • minruntime=value β€” Set the remaining battery runtime when the clone UPS switches to LB (seconds).

🧚 IMPLEMENTATION 🧚

The port specification in ups.conf(5) should reference the local driver socket (or Windows named pipe) that the "real" UPS driver is using. For example:

[realups]
   driver = usbhid-ups
   port = auto

[clone-outlet-1]
   driver = clone
   port = usbhid-ups-realups
   load.on = outlet.1.load.on
   load.off = outlet.1.load.off
   load.status = outlet.1.status
   desc = "Outlet 1 of the Real UPS"
   [...]

This driver supports instant commands to initiate a forced shutdown for upsmon or similar clients which MONITOR this virtual UPS device, if the outlet status is currently on and no other shutdown was initiated yet (setting the virtual UPS shutdown delay timer to offdelay and issuing an FSD via ups.status):

  • shutdown.return β€” power the outlet back on after ondelay;
  • shutdown.stayoff β€” keep the outlet off.

Such commands are propagated to the "real" driver using the NUT socket protocol (using the command names specified in the load.off and load.on driver configuration options), if the shutdown or start timers are set at the moment, or if the "real" device is not "online" and its known battery charge or runtime are below the configured "low" thresholds.

The outlet status is determined using the name specified by the load.status driver option if it's set β€” otherwise it's just assumed by the latest completed shutdown/start operation (using unknown outlet number). 🀷

The driver does not support a common NUT device shutdown operation as such (clone -k just prints an error and bails out). periodt.

This driver also supports setting certain NUT variables at run-time:

  • battery.charge.low β€” see mincharge in driver options;
  • battery.runtime.low β€” see minruntime in driver options.

Compared to the "real" driver's readings, this driver also adds (or overrides) the following data points: ups.delay.shutdown, ups.delay.start, ups.timer.shutdown and ups.timer.start. It keeps track of the "real" driver's values of battery.charge and battery.runtime (the actual current readings) to decide on automated outlet shutdown later on. πŸ”₯


πŸ‘‘ IMPORTANT πŸ‘‘

⚠️ Unlike a real UPS, you should not configure a upsmon primary mode for this driver. When a upsmon(8) primary sees the OB LB flags and tells the upsd(8) data server that it's OK to initiate the shutdown sequence, the server will latch the FSD status, and it will not be possible to restart the systems connected without restarting the upsd server. πŸ’€

This will be a problem if the power returns after the clone UPS initiated the shutdown sequence on its outlet, but returns before the real UPS begins shutting down. The solution lives in the clone driver itself β€” it will insert the FSD flag if needed, without the help of an upsmon primary. 🫢


🌈 CAVEATS 🌈

The clone UPS will follow the status of the real UPS driver. You can only make the clone UPS shut down earlier than the real UPS driver, never later. If the real UPS driver initiates a shutdown, the clone UPS driver will immediately follow. fr fr.

Be aware that the commands to shutdown/restart an outlet on the real UPS drivers are not affected, so if you tell the real UPS driver to shut down the outlet of the clone UPS driver, your clients will lose power without warning. 😭

If you use service management frameworks like systemd or SMF to manage the dependencies between driver instances and other units, then you may have to set up special dependencies (e.g. with systemd "drop-in" snippet files) to queue your clone drivers to start after the "real" device drivers. ⭐


πŸ’œ AUTHOR πŸ’œ

Arjen de Korte <adkorte-guest@alioth.debian.org>


πŸ“ SEE ALSO πŸ“

upscmd(8), upsrw(8), ups.conf(5), clone-outlet(8), nutupsdrv(8)

✨ Dummy driver ✨

The "repeater" mode of the dummy-ups driver is in some ways similar to the clone and clone-outlet drivers, by relaying information from a locally or remotely running "real" device driver (and NUT data server).

dummy-ups(8)

🌸 Internet Resources 🌸

The NUT (Network UPS Tools) home page: https://www.networkupstools.org/historic/v2.8.5/


okay that's the whole page bestie, you ate that πŸŽ€ this was Network UPS Tools 2.8.5, dated 10/07/2026 β€” clone girl summer, iykyk πŸ’…πŸ¦‹βœ¨

πŸ“¦ where this page comes from