SShortSingh.
Back to feed

三丰云免费云服务器实测:一次磁盘告警,和我的备份改造记录

0
·1 views

这台 1核1G 的免费云服务器我一直在跑,平时没什么存在感,直到上周收到一条磁盘使用率 85% 的告警。 不是大事,但正好借这个机会,把一直拖着没做的备份改造做了。顺便把过程和踩过的坑记下来。 配置没变过:1核1G、5M 带宽。上面跑着一个 Django 小站、PostgreSQL、Nginx,外加两个定时脚本——一个每天抓数据入库,一个每周打包备份。 真正占磁盘的不是代码,是日志和备份文件。Django 的日志没做轮转,PostgreSQL 的 WAL 没有清理策略,备份脚本是手动写的,每次全量打包,堆了十几份。 三个月下来,20G 的盘用了 17G。 登录上去先看了一圈: df -h du -sh /var/log/* | sort -rh | head du -sh /var/backups/* | sort -rh | head 结果很直白:/var/log 里一个没轮转的 Django 日志占了 4.2G,/var/backups 里堆了 11 个全量包,最早的是两个月前的。 顺手查了下 inode,还好没到紧张的程度。这一步别省——磁盘满和 inode 满是两回事,处理方式完全不同。 第一,日志轮转。 之前靠手动清空文件,这次老老实实配了 logrotate,按天切、留 14 天、压缩归档。 第二,备份改增量。 原来的脚本是 tar -czf 全量打包,现在改成 rsy

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

I vibe-coded a cassette deck for family memory — K7 Mémoire (Sanity Challenge Path 2)

I vibe-coded a cassette deck for family memory — K7 Mémoire (Sanity Challenge Path 2) Author: Chaminade (Dondah Chamiande Adjolou) · Lomé, Togo Challenge: Sanity Challenge Path 2 — Vibe-code something strange (Sep 18–Oct 4, 2026 PDT) Tag: #sanitychallenge Live deck: https://k7-memoire.vercel.app Embedded Studio: https://k7-memoire.vercel.app/studio Sanity project ID: nh4vx26w · Dataset: production In Lomé, family history often travels by voice before it travels by page. I did not want another blog layout for that. Path 2 of the Sanity Challenge asks for something strange — so I vibe-coded K7 M

0
ProgrammingDEV Community ·

How to Build an AI Research Agent With Citations

Day 2 of 30 Days of Search for AI Agents. I want a research agent to give me something I can check. For each finding, I should be able to open the original document and decide whether it supports the statement. A bibliography at the bottom leaves too much detective work to the reader. Quick Summary: To build an AI research agent with citations, give it a scoped question, retrieve evidence, and keep each finding attached to its supporting sources.

0
ProgrammingDEV Community ·

Nobody in our app ever sees the Stripe customer portal, and four verbs are the reason

Nakodo has three plans, and the pricing page makes a promise in its FAQ: "Can I change or cancel my plan? Yes, any time in Settings. If you move to a smaller plan, your extra campaigns are paused rather than deleted." The fastest way to half-keep that promise is a button that opens the Stripe customer portal. We do not do that, and the decision has earned its keep. This is the shape we ended up with.

0
ProgrammingDEV Community ·

SQL Transactions

SQL Transactions A deep-dive walkthrough of database transactions — covering the ACID properties as precise, individually meaningful guarantees, BEGIN/COMMIT/ROLLBACK mechanics and savepoints, isolation levels and the specific concurrency anomalies (dirty reads, non-repeatable reads, phantom reads) each one prevents or permits, locking and how it underlies isolation, deadlocks and how to reduce them, the write-ahead transaction log as the mechanism behind durability, the real costs of long-running transactions, and how all of this maps onto EF Core's SaveChanges and explicit transaction APIs.

三丰云免费云服务器实测:一次磁盘告警,和我的备份改造记录 · ShortSingh