__netbox: add mange.py calls recommended from upstream

Calls where added because there are used upstream in the
`upgrade.sh`-Script, too.

Upgrade-Script:
  https://github.com/netbox-community/netbox/blob/develop/upgrade.sh
This commit is contained in:
matze 2020-09-28 20:04:22 +02:00
parent b55186544f
commit 050812305b
1 changed files with 7 additions and 1 deletions

View File

@ -64,11 +64,17 @@ EOF
# Set final permissions.
chown -R netbox /opt/netbox
# NetBox manage scripts
# Run database migrations.
sudo -u netbox /opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py migrate
# Generate static assets.
sudo -u netbox /opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py collectstatic --no-input
# Delete any stale content types
sudo -u netbox /opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py remove_stale_contenttypes --no-input
# Delete any expired user sessions
sudo -u netbox /opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py clearsessions
# Clear all cached data
sudo -u netbox /opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py invalidate all
# Remove temporary working directory.
cd /