Helper Commands
Create a small, consistent set of shell scripts for daily Odoo administration. These wrappers reduce the chance of typos and make common tasks fast to execute from any directory.
Overview
Day-to-day Odoo administration involves repeating the same systemctl and journalctl
commands. Placing short wrapper scripts in /usr/local/bin makes them available
system-wide without needing to remember full command syntax.
/usr/local/bin?
Scripts placed in /usr/local/bin are on the default PATH for all users.
They can be executed from any directory without a path prefix.
Command Reference
| Command | Description | Underlying Command |
|---|---|---|
odoo-help | Display all available helper commands | Prints a usage summary |
odoo-status | Show the Odoo service status | sudo systemctl status odoo --no-pager |
odoo-start | Start the Odoo service | sudo systemctl start odoo |
odoo-stop | Stop the Odoo service | sudo systemctl stop odoo |
odoo-restart | Restart the Odoo service | sudo systemctl restart odoo |
odoo-log | Follow the Odoo log in real time | tail -f /opt/odoo/logs/odoo.log |
Create the Scripts
Create each script as a plain text file, add a shebang line, and make it executable.
odoo-help
sudo tee /usr/local/bin/odoo-help > /dev/null <<'EOF' #!/bin/bash echo "Odoo Administration Helper Commands" echo "────────────────────────────────────" echo " odoo-status Show service status" echo " odoo-start Start the service" echo " odoo-stop Stop the service" echo " odoo-restart Restart the service" echo " odoo-log Follow the log file" EOF sudo chmod +x /usr/local/bin/odoo-help
odoo-status
sudo tee /usr/local/bin/odoo-status > /dev/null <<'EOF' #!/bin/bash sudo systemctl status odoo --no-pager EOF sudo chmod +x /usr/local/bin/odoo-status
odoo-start
sudo tee /usr/local/bin/odoo-start > /dev/null <<'EOF' #!/bin/bash sudo systemctl start odoo echo "Odoo started." EOF sudo chmod +x /usr/local/bin/odoo-start
odoo-stop
sudo tee /usr/local/bin/odoo-stop > /dev/null <<'EOF' #!/bin/bash sudo systemctl stop odoo echo "Odoo stopped." EOF sudo chmod +x /usr/local/bin/odoo-stop
odoo-restart
sudo tee /usr/local/bin/odoo-restart > /dev/null <<'EOF' #!/bin/bash sudo systemctl restart odoo echo "Odoo restarted." EOF sudo chmod +x /usr/local/bin/odoo-restart
odoo-log
sudo tee /usr/local/bin/odoo-log > /dev/null <<'EOF' #!/bin/bash tail -f /opt/odoo/logs/odoo.log EOF sudo chmod +x /usr/local/bin/odoo-log
Example Usage
After installation, all commands are immediately available from any directory.
# Display available helper commands odoo-help # Check if Odoo is running odoo-status # Restart after a configuration change odoo-restart # Follow the live log output odoo-log
The helper commands wrap standard Linux utilities. They do not replace
systemctl or journalctl — they just make the most common
operations faster and less error-prone during daily administration.
Verification
which odoo-help odoo-help odoo-status
- ✓
which odoo-helpreturns/usr/local/bin/odoo-help - ✓ All scripts are executable (
ls -la /usr/local/bin/odoo-*) - ✓
odoo-statusshows the current service state - ✓
odoo-restartsuccessfully restarts the service - ✓
odoo-logshows log output