fix cron on start

This commit is contained in:
Mateusz Gruszczyński 2025-02-24 08:26:21 +01:00
parent 9b2d2ac7d9
commit 05abc1c795
3 changed files with 8 additions and 4 deletions

1
app.py
View File

@ -1393,6 +1393,5 @@ def delete_old_logs():
if __name__ == '__main__':
with app.app_context():
reschedule_jobs()
scheduler.start()
atexit.register(lambda: scheduler.shutdown())
app.run(host='0.0.0.0', port=5581, use_reloader=False, debug=True)

View File

@ -122,8 +122,8 @@
<button type="submit" name="action" value="download" class="btn btn-lg btn-success me-2">
<i class="bi bi-file-earmark-zip"></i> Pobierz zip zaznaczonych
</button>
<button type="submit" name="action" value="delete" class="btn btn-lg btn-danger" onclick="return confirm('Na pewno usunąć zaznaczone backupy?');">
<i class="bi bi-trash"></i> Usuń zaznaczone backupy
<button type="submit" name="action" value="delete" class="btn btn-lg btn-danger" onclick="return confirm('Na pewno usunąć zaznaczone pliki?');">
<i class="bi bi-trash"></i> Usuń zaznaczone pliki
</button>
</form>
</div>

View File

@ -28,7 +28,7 @@
<body>
<nav class="navbar navbar-expand navbar-dark bg-dark mb-4">
<div class="container-fluid">
<a href="{{ url_for('index') }}" class="navbar-brand">Backup RouterOS</a>
<a href="{{ url_for('index') }}" class="navbar-brand">RouterOS Backup</a>
<div>
{% if session.user_id %}
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary me-2">Dashboard</a>
@ -80,6 +80,11 @@
</div>
</div>
<footer class="footer bg-light py-3 mt-auto">
<div class="container text-center">
<span class="text-muted">&copy; 2025 RouterOS Backup</span>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<script>