Spa*_*awk 6 backup cache rsync restore
我刚刚从rsync
图像中恢复了我的 Raspberry Pi 服务器。在备份过程中,我已经排除了/var/cache/*
,认为这会恢复一个空目录。这有效,但是当我重新启动时,一个进程抱怨它无法在以下邮件中写入它。
Subject: status report from ddclient@raspberrypi
...
WARNING: updating <url>.dynu.com: nochg: No update required; unnecessary attempts to change to the current address are considered abusive
FATAL: Cannot create file '/var/cache/ddclient/ddclient.cache'. (No such file or directory)
Run Code Online (Sandbox Code Playgroud)
我检查了 的权限/var/log
,与我的 Arch 桌面系统一致。
$ ls -ld /var/cache/
drwxr-xr-x 3 root root 4096 Aug 15 13:23 /var/cache/
Run Code Online (Sandbox Code Playgroud)
我还需要做什么吗?如果权限是a-w
,那么非root进程怎么能写在这里呢?
/var/cache
不是像/var/tmp
. 每个需要它的服务都有一个/var/cache
具有适当权限的子目录,用于存储文件。
在 Debian 和衍生发行版上,您可以运行dpkg -S /var/cache
以查找在 下设置目录的软件包/var/cache
,并apt-get --reinstall install PACKAGE_NAME …
重新安装这些软件包并在/var/cache
.
某些应用程序会即时重新填充其缓存。其他人需要明确填充缓存;这通常由 cron 作业完成。一些需要手动填充;例如,要使用apt-file
,您首先需要以apt-file update
root身份运行。
/var/cache
Debian 上有一项无法重建:/var/cache/debconf/config.dat
. 该文件包含您在安装 Debian 软件包期间给出的答案。这是Debconf 中的一个长期存在的错误。