for d in `kubectl -n your-namespace get deployments | grep -v NAME | awk '{print $1}'`; do kubectl -n your-namespace get deployment $d -o json > $d.json; done
for d in `kubectl -n your-namespace get deployments -o=name | cut -f2 -d'/'`; do kubectl -n your-namespace get deployment $d -o json > $d.json; done
kubectl -n your-namespace get deployments -o json > deployments.json
[Unit]
Description=Ping service
[Service]
WorkingDirectory=/tmp
ExecStart=/usr/bin/wget http://127.0.0.1/taskmanager.php
Restart=always
# Restart service after 60 seconds
RestartSec=60
KillSignal=SIGINT
SyslogIdentifier=pingsvc
User=www-root
#Environment=ASPNETCORE_ENVIRONMENT=Production
#Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
#!/bin/sh
while true
do
python3 ./bot.py
sleep 1
done
def client_exists(self, user_id):
"""Проверяем есть ли клиент уже в базе данных"""
self.cursor.execute("""SELECT * FROM clients WHERE user_id = %s""", (user_id,))
return bool(len(self.cursor.fetchall()))
def client_exists(self, user_id):
"""Проверяем есть ли клиент уже в базе данных"""
self.cursor.execute("""SELECT * FROM clients WHERE user_id = %s""", (user_id,))
return self.cursor.fetchone() is not None