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.

Why /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

CommandDescriptionUnderlying Command
odoo-helpDisplay all available helper commandsPrints a usage summary
odoo-statusShow the Odoo service statussudo systemctl status odoo --no-pager
odoo-startStart the Odoo servicesudo systemctl start odoo
odoo-stopStop the Odoo servicesudo systemctl stop odoo
odoo-restartRestart the Odoo servicesudo systemctl restart odoo
odoo-logFollow the Odoo log in real timetail -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

bash
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

bash
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

bash
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

bash
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

bash
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

bash
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.

bash
# 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
These are convenience wrappers

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

bash
which odoo-help
odoo-help
odoo-status
  • which odoo-help returns /usr/local/bin/odoo-help
  • All scripts are executable (ls -la /usr/local/bin/odoo-*)
  • odoo-status shows the current service state
  • odoo-restart successfully restarts the service
  • odoo-log shows log output
Back to top