我有两个问题,都与 linux 终端中的 Tar 相关。为了让您了解我所看到的内容,我在下面发布了指向我的桌面图像的链接。 http://worldofclucky.net/errors/ServerLag/desktop.png Linux Ubuntu 12.04 桌面 http://wocl.net/errors/ServerLag/desktop.png 1
正如您在左上角的终端上看到的那样,有三个消息:
tar: ./Frisnuk/Frisnuk/region/r.0.0.mca: file changed as we read it
tar: ./Frisnuk/server.log: file changed as we read it
ls: cannot access home/clucky/MinecraftServers/.backups/Backup-08-January-2013-15:31.tar.gz: No such file or directory
在前两条消息中,它指出无法读取文件,因为它已更改。该文件已更改,因为有一个服务器在运行时修改内容,这对整体备份不应该是一个问题,因为它们是来自 Minecraft 服务器的区域文件,这些文件可以彼此分开使用。我主要关心的是,它是跳过文件还是重做它们?如果它正在跳过文件,这可能是备份中的主要漏洞,因为有恶意的播放器可能会在备份时故意修改该区域,从而阻止其备份。因此,如果它正在跳过文件,我怎样才能重复它而不必重做整个备份?
在第三条消息中,它指出它无法访问文件home/clucky/MinecraftServers/.backups/Backup-08-January-2013-15:31.tar.gz但是,正如您在下面的窗口中清楚地看到的那样它,该文件确实存在。我觉得这很奇怪,特别是因为如果您查看脚本,文件大小检查发生在脚本末尾,在备份发生很久之后。
下面我发布了脚本,以便任何试图帮助我的人都可以轻松修改它:
timedate=`date '+%d-%B-%Y-%H:%M'`
echo "-------------- $timedate --------------" >> /home/clucky/MinecraftServers/backup.log
echo "[`date '+%H:%M'`] Starting Minecraft Backup" >> /home/clucky/MinecraftServers/backup.log
nice --adjustment=19 tar -zcpf /home/clucky/MinecraftServers/.backups/Backup-$timedate.tar.gz \
--directory /home/clucky/MinecraftServers/ \
--exclude=SkyBlockkit \
--exclude=Tekkit \
--exclude=Vanilla \
--exclude=test \
--exclude=Zflocco_LP \
--exclude=Mortuus/plugins/dynmap/web --exclude=Mortuus/plugins/AutoSaveWorld/backups --exclude Mortuus/CraftBukkitVersion --exclude=Mortuus/orebfuscator_cache --exclude=Mortuus/plugins/#Removed --exclude=Mortuus/server.log \
--exclude=Frisnuk/plugins/dynmap/web --exclude=Frisnuk/plugins/AutoSaveWorld/backups --exclude Frisnuk/CraftBukkitVersion --exclude=Frisnuk/orebfuscator_cache --exclude=Frisnuk/plugins/#Removed --exclude=Frisnuk/plugins/#AwaitingUpdate--exclude=Frisnuk/server.log \
--exclude=dailybackup.log \
--exclude=.backups \
--exclude=backup.log \
--exclude=backups.log \
--exclude=backupscript.sh \
--exclude=dailybackup.sh .
echo "[`date '+%H:%M'`] Finishing Minecraft Backup" >> /home/clucky/MinecraftServers/backup.log
#Purge files 3 days old
echo "[`date '+%H:%M'`] Purging Old Backups" >> /home/clucky/MinecraftServers/backup.log
find /home/clucky/MinecraftServers/.backups* -mmin +4320 -exec rm {} \;
echo "[`date '+%H:%M'`] Purging Complete" >> /home/clucky/MinecraftServers/backup.log
#Read back file size
filesize=$(ls -lah home/clucky/MinecraftServers/.backups/Backup-$timedate.tar.gz | awk '{ print $5}')
echo " Total Compression Size: $filesize\n" >> /home/clucky/MinecraftServers/backup.log
提前感谢您的帮助,如果您需要更多信息,请询问。