arch logs

This commit is contained in:
2024-08-24 06:50:37 +03:00
parent d4146682a8
commit 1aee085398
3 changed files with 28 additions and 2 deletions

5
.gitignore vendored
View File

@@ -2,4 +2,7 @@
.idea/
.env
.linux_venv
alembic/versions/
alembic/versions/
**/__pycache__/
venv/
/logs/*

21
archive_logs.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
# Get the current date and time in YYYY-MM-DD-HHMMSS format
current_datetime=$(date +"%Y-%m-%d-%H%M%S")
# Archive name
archive_name="logs-$current_datetime.tar.gz"
# Create the logs directory if it doesn't exist
mkdir -p logs
# Create a tar.gz archive of all .log files
tar -czf "$archive_name" *.log
# Move the archive to the logs directory
mv "$archive_name" logs/
# Remove the original .log files
rm -f *.log
echo "Logs archived and moved to logs/ directory. Original log files removed."

4
start_celery.sh Normal file → Executable file
View File

@@ -1 +1,3 @@
celery -A background.celery worker --loglevel=info
#!/bin/bash
ulimit -n 97816
/var/www/sipro/Sipro-Stocks/venv/bin/celery -A background.celery worker --loglevel=info --logfile=/var/www/sipro/Sipro-Stocks/celery.log