I read in the documentation about Pack Size (Tuning Backup Parameters — restic 0.16.5 documentation) that restic saves temporary pack files created before uploading to a temporary directory, but It will cause my nvme hard drive write volume to increase significantly, affecting the hard drive life.
So, Can use RAM to store temporary files instead of temp directory? I have dozens of GB of free memory.
Hi @greenanna-diana !
Yes, you can. Create a drive in RAM and then tell restic to use it by giving the path to the RAM drive in the ‘TMPDIR’ variable.
The --cache-dir
switch may come in handy as well! Just be aware that your cache would have to be rebuilt every time you power cycle.
Just make sure to set a size limit for the RAM disk. The cache can contain a substantial amount of data depending on the repository.
Does the significant volume increase on the drive comes from the temp dir, the cache dir, or both ?
It depends
The cache pulls down indices of what has changed in the repo since Restic last run. It also keeps copies of packs that have been downloaded as part of restores.
The tmpdir is used by backups to create the pack and matching index files and fill them to appropriate size before uploading to the repo.
Cache and temp both used for the check command.
Depending on which of these activities you perform the most will indicate which type of storage is used most.
If you have lots of changes each time you back up and not many other computers using the same repo, then the tmpdir will do more writes. Otherwise the cache.