问题原文
原帖链接 · Elite_Dragon1337 · CC BY-SA 3.0
Is it safe to create a tarball of a directory while the files in the directory are being used (read+write)?
I want to create a backup of a 20GB directory without having to shut down my application server.
I don't mind if the files are changed while the tar is being created, as long as every file is present in the archive, I'm fine with it.
已采纳解答
原帖链接 · Ondra Sniper Flidr · CC BY-SA 3.0
It depends. When you're making tarbal (or rsync copy) of changing data, files will be copied in state when copy of that one file started. And that is a trap. If you will have ie. 100 files in directory, all those files will be changing during backup and backup of one file will takes 1s, last copied file will be for 99s newer than first one. This can lead to useless backup if you need all data presenting same time window (ie. you cannot backup database this way).
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
