istro

System

Maintenance and Power

Keep the server clean and healthy, fix problems safely, and reboot, shut down or sleep it.

Bistro runs most upkeep by itself. This page covers the Maintenance and Power pages and the commands behind them. For memory, the 15-minute check and safe updates, see Self-management.

#Run Upkeep Now

The Maintenance page shows the last cleanup, log size, package cache and next maintenance time. The Run Now cards do one task each.

CardWhat it does
Clean Junk FilesRemoves caches and old logs. Keeps your files and apps.
Health checkChecks disks, memory and services.
Trim SSDsKeeps SSDs fast. Also runs every week.
Shrink logsKeeps the newest 50 MB of the journal.
bistro clean                  # remove junk and print the space freed
bistro maint trim             # trim SSDs
bistro maint shrink-logs      # keep the newest 50 MB of logs
bistro events 20              # what Bistro recorded: cleanups, restarts, alarms

Cleanup never touches your files, containers, volumes or VM disks. It also skips any file a program has open. Cache files in a home folder go only after 30 days without a read or a change.

#Automatic Maintenance

The Automatic Maintenance card sets a time of day, daily security updates, reboot after updates and the weekly cleanup. The settings live in /etc/bistro/bistro.conf.

KeyDefaultMeaning
MAINT_TIME04:00Window for updates and the Sunday cleanup
AUTO_UPDATESyesSecurity updates every day
AUTO_REBOOTnoReboot in the window when an update needs it
AUTO_CLEANyesWeekly junk cleanup

The page also lists what changed on the server and any Bistro file edited by hand. You can put the Bistro version back.

bistro changes diff 7         # packages, services, ports and files changed in 7 days
bistro changes drift          # settings files changed by hand

#Self-Healing

When a service fails, Bistro reads its log and names the cause: out of memory, disk full, port in use, config error, dependency down or crash loop. Then it can run one fix from a fixed safe list. Whether it runs by itself depends on the autopilot mode (Only Record, Ask Me, Fix by Itself).

bistro heal status
bistro heal diagnose nginx.service
bistro heal fix trim-logs
bistro heal history
FixWhat it does
clean-diskRuns the cleanup
trim-logsShrinks the journal to 50 MB
free-inodesCleans, then shrinks the journal
time-syncRestarts the time service
start-timer UNITStarts an enabled Bistro timer that stopped
restart-container UNITRestarts a container service that is unhealthy
restart-service UNITRestarts a failed service
ease-app ID, ease-unit UNITGives a busy app or service low CPU and disk priority
add-swapMakes a swap file when there is none
renew-cert NAMEReloads Caddy to retry a certificate (waits for the window)

Every fix is logged, and each one keeps a cool-down per thing. Run bistro heal history to see what happened.

#Tune the Machine

Care tunes the OS for the hardware it finds and watches for wear.

bistro care status
bistro care apply             # disk scheduler, BBR network, weekly TRIM
bistro care profile auto      # or web, database, ai, media, general
bistro care history

The daily pass checks SSD wear, memory errors, disk errors, idle heat, old kernels, firmware updates and pending restarts. Firmware is never flashed without you. Machine size profiles (tiny, small, standard) are in Settings.

#Right-Size Apps and VMs

Rightsize compares what each app and VM was given with what it used. It suggests peak use times 1.5. Give it a few busy days first.

bistro rightsize
bistro rightsize apply app jellyfin 1024    # set the memory limit in MB
bistro rightsize apply vm win11 4096        # the VM must be stopped

#Database Care

Bistro keeps database apps tidy: VACUUM for PostgreSQL, OPTIMIZE for MariaDB, memory purge for Valkey and Redis, and an integrity check for SQLite. A timer runs it Sunday night, and it skips busy moments. An app whose data grew more than 50 percent in a week goes to the inbox.

bistro dbcare status
bistro dbcare run                 # all databases now, or run ID for one
bistro dbcare slow postgres       # recent slow queries
bistro dbcare off

#Remove Unticked App Types

If you untick Containers, VMs or Flatpak in Settings, the packages stay until you prune them. Bistro lists first, saves the specs, and keeps your data.

bistro apps prune-unticked          # list only
bistro apps prune-unticked --yes

Exports go to /var/lib/bistro/prune-backup/DATE/. If an export fails, that category stays.

#Reboot and Shut Down

The Power page reboots or shuts down now or at a set time. It shows a pending schedule and a notice when a reboot is needed.

bistro reboot                   # asks first
bistro poweroff --in 30         # in 30 minutes
bistro power cancel

#Sleep and Wake

The server can suspend when idle. Idle means nobody logged in, low load, little network traffic and no sleep inhibitor. Wake-on-LAN is switched on first.

bistro sleep                    # status and why it is not idle
bistro sleep idle 60            # suspend after 60 idle minutes (5 to 1440)
bistro sleep wake-at 07:30      # wake every day at 07:30
bistro sleep now                # suspend now
bistro wol NAME                 # wake it from another machine

#Power Use

Bistro reads the CPU energy counters and adds GPU power. Without counters it estimates from load and TDP_WATTS. Set PRICE_KWH and CURRENCY in Settings.

bistro power                    # watts now
bistro power cost 30            # kWh and money over 30 days
bistro power apps               # energy per app (an estimate)
bistro power spindown /dev/sdb 20   # let a hard disk sleep after 20 minutes
bistro power spindown list