I just restored my Raspberry Pi server from an rsync image. During the backup, I had excluded /var/cache/*, thinking that this would restore an empty directory. This worked, but when I rebooted, a process complained that it couldn't write to it in the following mail.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 abusiveFATAL:    Cannot create file '/var/cache/ddclient/ddclient.cache'. (No such file or directory)I checked the permissions of /var/log, which were consistent with my Arch desktop system.$ ls -ld /var/cache/drwxr-xr-x 3 root root 4096 Aug 15 13:23 /var/cache/Do I have to do anything else? If the permissions are a-w, then how can non-root processes write in here?
How should I restore /var/cache?
backup;rsync;cache;restore
/var/cache is not a free-for-all like /var/tmp. Each service that requires it has a subdirectory in /var/cache with appropriate permissions for it to store files.On Debian and derived distributions, you can run dpkg -S /var/cache to find what packages have set up directories under /var/cache, and apt-get --reinstall install PACKAGE_NAME  to reinstall these packages and re-create the directories under /var/cache.Some applications repopulate their cache on the fly. Others need to have the cache filled explicitly; this is often done by a cron job. A few need to be populated manually; for example, to use apt-file, you'll first need to run apt-file update as root.There is one piece of /var/cache on Debian that cannot be reconstructed: /var/cache/debconf/config.dat. This file contains the answers that you gave during the installation of Debian packages. This is a long-standing bug in Debconf.