Always Up. Always Clean. Always Secure.
upml (Update My Linux) is a powerful, elegant, and flexible Bash script designed to automate the maintenance and optimization of Ubuntu servers.
It handles system updates, upgrades, package cleanup, health checks, detailed logging, configuration management, and real-time Discord notifications — including full log file uploads for complete monitoring.
With a clean and professional console output, smart tab completion for all commands, robust error handling, and easily customizable settings, upml is the all-in-one solution to keep your servers secure, updated, efficient, and fully under control — with minimal manual effort.
-
Automated System Maintenance:
- Fix broken packages
- Update package lists
- Upgrade and fully upgrade packages
- Clean unnecessary and orphaned packages
-
System Health Checks:
- Display Disk Usage, Memory Usage, and Top Processes
-
Discord Notifications:
- Real-time notifications for:
- Update start and completion
- Errors and issues
- Reboot status
- Full log file uploads as attachment
- Real-time notifications for:
-
Flexible Logging:
- Logs saved separately by date:
/var/log/upml/upml-YYYY-MM-DD-HHMMSS.log - Automatic log rotation (deletes logs older than 30 days)
- Option to specify a custom log file
- Logs saved separately by date:
-
Configuration File:
- Global settings stored at
/etc/upml.conf - Easy editing without modifying the script
- Global settings stored at
-
Command-Line Options:
- Dry-run mode to simulate without executing
- Option to disable Discord notifications
- Ability to set or view configuration easily
-
Tab Completion Support:
- Smart autocompletion for all available command-line options
-
Enhanced Console Output:
- Beautiful, centered, boxed headers
- Professional, clean design
-
Advanced Error Handling:
- Exits on first error
- Captures line and command that caused errors
- Sends error alerts via Discord
Note: Configuring a Discord Webhook is optional. If not configured, Discord notifications will be disabled, but system maintenance will still work normally.
To create a webhook:
- Open your Discord server settings.
- Navigate to Integrations > Webhooks.
- Click New Webhook.
- Name your webhook and select the channel where messages will be sent.
- Click Copy Webhook URL to copy the generated URL.
You can set your webhook in two ways:
- During manual installation (when running
installer.sh). - After installation, using:
sudo upml --set-webhook
Step 1: Download the latest .deb package from Releases.
Step 2: Install the package:
sudo dpkg -i upml_X.X.X.debStep 3: (Optional) Fix missing dependencies:
sudo apt-get install -fThis will:
- Install necessary dependencies (
curl,deborphan) - Install
upmlinto/usr/local/bin/ - Create
/etc/upml.conf - Create
/var/log/upml/
Step 1: Install dependencies:
sudo apt update
sudo apt install deborphan curl -yStep 2: Download the project:
Clone or download the upml project files:
git clone https://github.com/demartini/upml.git
cd upml(Or manually copy the files.)
Step 3: Make the installer executable:
chmod +x scripts/installer.shStep 4: Run the installer:
sudo ./scripts/installer.shThis will:
- Install
upmlinto/usr/local/bin/ - Ask for your Discord Webhook URL
- Create
/etc/upml.confwith settings - Create
/var/log/upml/
Automate maintenance with cron. For example, every Sunday at 2:00 AM:
sudo crontab -eAdd:
0 2 * * SUN /usr/local/bin/upmlupml uses a configuration file located at /etc/upml.conf.
You can manually edit this file to change settings:
| Variable | Description |
|---|---|
DISCORD_WEBHOOK |
(Optional) Discord Webhook URL for alerts. |
LOG_DIR |
Directory where log files will be saved. |
Example of /etc/upml.conf:
DISCORD_WEBHOOK="https://discord.com/api/webhooks/your_webhook_here"
LOG_DIR="/var/log/upml"If no webhook is configured,
upmlwill still run but will not send Discord notifications.
| Command | Description |
|---|---|
upml -d, --dry-run |
Simulate all operations without making any changes. |
upml -n, --no-discord |
Disable all Discord notifications. |
upml -l, --logfile <path> |
Save log output to a custom file instead of /var/log/upml/upml-YYYY-MM-DD.log. |
upml -s, --set-webhook |
Set or update your Discord Webhook URL in /etc/upml.conf. |
upml -c, --show-config |
Display the current configuration (Webhook and Log Directory). |
upml -h, --help |
Show help information for available options. |
upml -v, --version |
Display the current version of upml. |
Run normally:
sudo upmlSimulate operations (no changes):
sudo upml --dry-runRun without sending Discord notifications:
sudo upml --no-discordSave logs to a custom location:
sudo upml --logfile /tmp/upml-test.logCombine multiple options:
sudo upml --dry-run --no-discord --logfile /tmp/test.logTo completely remove upml:
If you installed using the .deb package:
sudo apt remove upmlIf you installed manually, run:
Step 1: Make the uninstaller executable:
chmod +x scripts/uninstaller.shStep 2: Run the uninstaller:
sudo ./scripts/uninstaller.shIf you are interested in helping contribute, please take a look at our contribution guidelines and open an issue or pull request.
See CHANGELOG for a human-readable history of changes.
Distributed under the MIT License. See LICENSE for more information.