StamusNetworks / scirius

Scirius is a web application for Suricata ruleset management and threat hunting.
GNU General Public License v3.0
635 stars 150 forks source link

Scirius backup at SELKS 5.0 #191

Open VN1977 opened 5 years ago

VN1977 commented 5 years ago

Hello! I try to backup scirius and migrate to another host. But if I start python manage.py scbackup I get error thet file manage.py not found. This file is located at /usr/share/python/scirius/bin. After start python manage.py scbackup from that path I get

Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
pevma commented 5 years ago

I think you would need to try with activating it first -

cd /usr/share/python/scirius/ && . bin/activate && python bin/manage.py .....

(as root)

VN1977 commented 5 years ago

It works. I made backup I decided to view list of all backups with command python manage.py listbackups This command sends the errors.

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 206, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 40, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/dbbackup/management/commands/listbackups.py", line 8, in <module>
    from ._base import BaseDbBackupCommand
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/dbbackup/management/commands/_base.py", line 9, in <module>
    class BaseDbBackupCommand(LabelCommand):
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/dbbackup/management/commands/_base.py", line 13, in BaseDbBackupCommand
    option_list = BaseCommand.option_list + (
AttributeError: type object 'BaseCommand' has no attribute 'option_list'
pevma commented 5 years ago

That probably is a separate bug. What is your Scirius version ?

VN1977 commented 5 years ago

I have the last version 3.2

pevma commented 5 years ago

If you make one more back up and repeat the list command - would the result be the same ?

VN1977 commented 5 years ago

I have made three backups and have the same problem with viewing list.

pevma commented 5 years ago

ok - this is a bug then, we should be able to list them. You do have the 3 backups though in the folder, right?

VN1977 commented 5 years ago

Exactly three backups.

xkill commented 4 years ago

Hi, same problem:

I installed SELKS yesterday based on the latest version. Upgraded all the packages and rebooted. Today I made a backup following the instructions at https://scirius.readthedocs.io/en/latest/backup-ce.html, but:

# /usr/share/python/scirius/bin/manage.py  listbackups
Traceback (most recent call last):
  File "/usr/share/python/scirius/bin/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 206, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 40, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/dbbackup/management/commands/listbackups.py", line 8, in <module>
    from ._base import BaseDbBackupCommand
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/dbbackup/management/commands/_base.py", line 9, in <module>
    class BaseDbBackupCommand(LabelCommand):
  File "/usr/share/python/scirius/local/lib/python2.7/site-packages/dbbackup/management/commands/_base.py", line 13, in BaseDbBackupCommand
    option_list = BaseCommand.option_list + (
AttributeError: type object 'BaseCommand' has no attribute 'option_list'

It could a problem with the django listbackups command, as scbackup is a custom command and not a django command. So, scirious should implement a sclistbackups command or remove this option from the documentation and the only way to list the backups is ls -ltr /var/backups/db-scirius-*