diff --git a/.gitignore b/.gitignore index 367b00b..4898ce7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ .idea/ .env .linux_venv -alembic/versions/ \ No newline at end of file +alembic/versions/ +**/__pycache__/ +venv/ +/logs/* diff --git a/archive_logs.sh b/archive_logs.sh new file mode 100755 index 0000000..f2472de --- /dev/null +++ b/archive_logs.sh @@ -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." diff --git a/start_celery.sh b/start_celery.sh old mode 100644 new mode 100755 index da59513..0290a5f --- a/start_celery.sh +++ b/start_celery.sh @@ -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