@luckydonaldsbots · Post #186 · 23.02.2019 г., 23:32
Will be updating software of the server, expect #downtime the next hour
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #22 · 19 јан.
Заметка начинающим, которые часто сталкиваются с подобной непоняткой. Ситуация следующая, есть список файлов: names = [ 'image.bmp', 'second.txt.bkp', 'data.db', '.config.cfg', 'file.ext.bkp' ] И мы хотим убрать у них окончание ".bkp". Не знаю зачем, пример довольно надуманный) Но суть он показывает, а это главное. Те, кто еще не очень знаком с библиотекой os.path или pathlib, вероятно решат обработать имена как строки. И тут вполне подойдет метод строки strip(). Что делает этот метод? Он отрезает указанные символы по обеим сторонам строки. Если ничего не указать, то убирает невидимые символы (пробелы, табуляции и переносы строк). В нашем случае будет выглядеть вот так: >>> name.strip('.bkp') То есть просим удалить строку '.bkp' по краям имени файла, если таковая есть. Можно применить аналогичный метод rstrip(), чтобы отрезать только справа, но для этого примера используем обычный. >>> for name in names: >>> print(name.strip('.bkp')) image.bm second.txt data.d config.cfg file.ext Хм, что-то не то с нашими именами! Что случилось??? Видим нежелательное переименование в именах, где и близко не было указанной строки '.bkp' А дело всё в том, что данный метод ищет не указанную строку, а указанные символы, и не важно в каком порядке. Для метода strip() строка '.bkp' это не паттерн для поискаа список символов. Потому он отрезал симовол 'p' от '.bmp' и удалил точку из файла '.config.cfg'. Как тогда правильно заменить именно паттерн? Для начинающего можно посоветовать метод строки replace(), который как раз использует для замены указанную строку целиком. В нашем примере заменим её на пустую строку. >>> for name in names: >>> print(name.replace('.bkp', '')) image.bmp second.txt data.db .config.cfg file.ext Уже лучше, но помните, это лишь пример про strip(). Для работы с именами файлов есть способы и более "правильные", дающие однозначно верный результат. Я взял файлы только в качестве примера. Даже replase() тут может сделать не то что ожидаем. Просто впредь будьте внимательны с этим strip(). #basic
Hashtags
Пребарај: #downtime
@luckydonaldsbots · Post #186 · 23.02.2019 г., 23:32
Will be updating software of the server, expect #downtime the next hour
Hashtags
@luckydonaldsbots · Post #124 · 01.02.2018 г., 15:18
Downtime in about one hour, as an now old docker version spammed my /run/ directory making any upgrades impossible. #downtime
Hashtags
@luckydonaldsbots · Post #193 · 24.02.2019 г., 02:39
#downtime#resolved
@luckydonaldsbots · Post #191 · 24.02.2019 г., 02:11
I'm still experiencing instabilities, still on it. #downtime#in_progress
Hashtags
@luckydonaldsbots · Post #290 · 11.12.2021 г., 22:33
Also there will be a scheduled downtime for two remaining bots tomorrow, in about 16h 20h from now : - @BanWarnBot - @RulesRulesBot Those have a database, and therefore they need to be take down to not loose any changes happining while the data is moved over. #scheduled#downtime
Hashtags
@luckydonaldsbots · Post #279 · 05.12.2021 г., 14:33
Unexpected downtime: Due to an failed software update, the server is now unreachable. Working hard on resolving the issue. #downtime#unexpected
Hashtags
@luckydonaldsbots · Post #162 · 21.10.2018 г., 13:20
Apperently also @anonymize_bot is affected. Currently looking into the issue. Update: It should now be back and running, but telegram reports about two thousand updates being still unprocessed, but that is decreasing. It will recover soon, bear with me, it works as fast as telegram allows it to. Update: @anonymize_bot It is now back to normal. #Anonymize#downtime'
Hashtags
@luckydonaldsbots · Post #111 · 06.12.2017 г., 10:53
Need another downtime today, in the same timeframe (13:00 UTC), as the main server is undergoing a hardware check. The backup server however should be online as soon as the database are copied. #scheduled_downtime#downtime
Hashtags
@luckydonaldsbots · Post #108 · 29.11.2017 г., 11:39
Expected downtime: Today, 13:00 UTC. Duration 1h. Delayed, see post below. Because my current server isn't powerful enough, especially regarding Disk IO speed, I will move part of the infrastructure to a new server with SSD storage. This means I have to take down the databases, and copy them over. I'll try to keep the bots running which doesn't need a database, like @ponbot, @anonymize_bot, @HeyAdminBot, @moustache_bot, etc. #expected_downtime#downtime
Hashtags
@luckydonaldsbots · Post #251 · 04.07.2020 г., 14:51
Maintenance: Moving @BanWarnBot to the new server. Okey going through the same procedure for @BanWarnBot now, hopefully without the database breaking this time. Turning the bot off for moving the database, so any /warns send in the meantime shouldn't get lost. As soon as it's on the new server it should pick up those, and carry out the needed actions. I'll take @BanWarnBot down in 10 minutes. Other bots should not be affected. #maintenance#downtime#BanWarnBot
Hashtags
@luckydonaldsbots · Post #188 · 24.02.2019 г., 01:05
If you docker refuses to start and sudo service docker status is showing logs like this: Feb 24 01:30:06 hostname dockerd[19544]: time="2019-02-24T01:30:06.718823877+01:00" level=error msg="stream copy error: reading from a closed fifo" It might be that /var/run/docker.sock is a mount in one of your containers. Therefore if that doesn't exist - and only shortly - it will be created as a folder, thus making it impossible for docker to start. Fix it with sudo rmdir /var/run/docker.sock, and sudo service docker start. #TechnicalDetails#downtime#in_progress
@luckydonaldsbots · Post #232 · 24.03.2020 г., 10:45
I will soon migrage some services onto a new server. Therefore those services will be unavailable for the next two hours: @JoinCaptchaBot@BanWarnBot@RulesRulesBot and @ForwardWhitelistBot. #downtime #JoinCaptchaBot#BanWarnBot#RulesRulesBot#ForwardWhitelistBot