arch logs
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,3 +3,6 @@
|
||||
.env
|
||||
.linux_venv
|
||||
alembic/versions/
|
||||
**/__pycache__/
|
||||
venv/
|
||||
/logs/*
|
||||
|
||||
21
archive_logs.sh
Executable file
21
archive_logs.sh
Executable 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
4
start_celery.sh
Normal file → Executable 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
|
||||
|
||||
Reference in New Issue
Block a user