Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py3.6 Scheduled tasks import paths fix, snapshot & scub #2570 #2585

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/rockstor/scripts/scheduled_tasks/crontabwindow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
Copyright (c) 2012-2023 RockStor, Inc. <https://rockstor.com>
This file is part of RockStor.

RockStor is free software; you can redistribute it and/or modify
Expand All @@ -13,13 +13,19 @@
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

from datetime import datetime, time

# Crontabwindow created as a separate module to avoid code duplication on
# snapshots and scrubs tasks
"""
Crontabwindow created as a separate module to avoid code duplication:
See scheduled_tasks/
- snapshots.py
- pool_scrub.py
- reboot_shutdown.py
"""



def crontab_range(range):
Expand Down
6 changes: 3 additions & 3 deletions src/rockstor/scripts/scheduled_tasks/pool_scrub.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
Copyright (c) 2012-2023 RockStor, Inc. <https://rockstor.com>
This file is part of RockStor.

RockStor is free software; you can redistribute it and/or modify
Expand All @@ -13,14 +13,14 @@
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

import time
import sys
import json
from datetime import datetime
import crontabwindow # load crontabwindow module
from scripts.scheduled_tasks import crontabwindow
from smart_manager.models import Task, TaskDefinition
from cli.api_wrapper import APIWrapper
from django.utils.timezone import utc
Expand Down
6 changes: 3 additions & 3 deletions src/rockstor/scripts/scheduled_tasks/snapshot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
Copyright (c) 2012-2023 RockStor, Inc. <https://rockstor.com>
This file is part of RockStor.

RockStor is free software; you can redistribute it and/or modify
Expand All @@ -13,13 +13,13 @@
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

import sys
import json
from datetime import datetime
import crontabwindow # load crontabwindow module
from scripts.scheduled_tasks import crontabwindow
from storageadmin.models import Share, Snapshot
from smart_manager.models import Task, TaskDefinition
from cli.api_wrapper import APIWrapper
Expand Down