I have a home server, which - between other things - stores my documents, mail archives etc.. It uses a ZFS RAIDZ, based on spinning hdds. The server also runs an off-line IMAP service, synchronizing my mail in 5 minutes intervals.
The problem is, that frequently I do not need to access mail (e.g. during the night, or when I am away on weekends). Still the disks keep spinning, making noise and wasting electric power, and the only process that wakes them up is this mail checking. I can disable the sync process for the night, but I am looking for a more universal solution.
I thought about putting the mail folders on an SSD, which holds the system anyway.
However, I do want my mail to be safe. Storing it purely on an SSD while a safe RAIDZ storage is at hand is something I would not call wise. So, my idea is to synchronize the SSD mail storage with the RAIDZ array once or twice per day - I think I need something like a very delayed write cache.
I thought about calling
rsync between SSD and RAIDZ, but this has a drawback: if an old mail gets corrupted on the SSD, the error will propagate to the array. Perhaps
rsync --ignore-existing will do the job, but maybe there is something that could work better?