diff --git a/.gitignore b/.gitignore index fb38d4ca..4016cb72 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ /database.db /bot_old.py /bot_old_2.py -/database.db \ No newline at end of file +/database.db +/backup_pg.sh +/config copy.py \ No newline at end of file diff --git a/backup_pg copy.sh b/backup_pg copy.sh new file mode 100644 index 00000000..d12bc6c7 --- /dev/null +++ b/backup_pg copy.sh @@ -0,0 +1,13 @@ +# Параметры +DB_NAME="имя_вашей_базы" +USER="имя_пользователя_postgresql" +HOST="localhost" +BACKUP_DIR="/путь/к/папке/резервных_копий" +DATE=$(date +\%Y-\%m-\%d-\%H\%M\%S) +BACKUP_FILE="$BACKUP_DIR/$DB_NAME-backup-$DATE.sql" + +# Команда для резервного копирования +pg_dump -U $USER -h $HOST -F c -f $BACKUP_FILE $DB_NAME + +# Удаление старых копий (например, старше 7 дней) +find $BACKUP_DIR -type f -name "*.sql" -mtime +7 -exec rm {} \; \ No newline at end of file diff --git a/handlers/notifications.py b/handlers/notifications.py index c5f9b4ee..a80e37ab 100644 --- a/handlers/notifications.py +++ b/handlers/notifications.py @@ -46,7 +46,7 @@ async def notify_expiring_keys(bot: Bot): ], [ InlineKeyboardButton(text='6 месяцев (540 руб.)', callback_data=f'renew_plan|6|{record["client_id"]}'), - InlineKeyboardButton(text='1 год (1080 руб.)', callback_data=f'renew_plan|12|{record["client_id"]}') + InlineKeyboardButton(text='1 год (1000 руб.)', callback_data=f'renew_plan|12|{record["client_id"]}') ], [ InlineKeyboardButton(text='Пополнить баланс', callback_data='replenish_balance'), @@ -120,4 +120,4 @@ async def notify_expiring_keys(bot: Bot): finally: await conn.close() except Exception as e: - print(f"Ошибка при отправке уведомлений: {e}") + print(f"Ошибка при отправке уведомлений: {e}") \ No newline at end of file