New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"crontab -e" backup file creation causes error if ~/.cache does not exist #173
Comments
I do not think I should create the .cache dir if it does not exist. This message is just a warning and a backup won't be created but otherwise things should work. There are basically three options:
Which one is preferable? |
My preference is either 2 or 3. |
Creating ".cache" when it does not exist is what applications usually do, and what the spec says ("If, when attempting to write a file, the destination directory is non-existant an attempt should be made to create it with permission 0700. " https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html ). |
Maybe PS: |
I'd prefer keeping it at .cache / XDG_CACHE_HOME. IMO an old backup file is something that does not have to be persistent. It is more like Oh I realized I made a mistake, can I revert? |
@t8m I would like to highlight that a cache is substituting runtime by storage and it holds content that can be re-computed without loss at any time if deleted. If the content of a cache does not fit that model, it's probably not a cache. A backup is very different from that in that it holds content that has no guarantee that it can be recomputed in fact its mere cause of existence is to protect against that very cause. So in some sense a cache directory could hardly be further from a semantic match to storing backup files, or am I'm missing something? |
That is one definition of cache which is a very strict one. In my opinion these backups are not meant to be permanent and I do not think there is a better place for such kind of "temporarily useful files" than .cache. |
@t8m what would be your definition of cache?
How is permanent or not important to this discussion? Please help me see it.
Why would |
XDG_DATA_HOME is for permanent storage so it is definitely not the place I would like to use. From the specs linked above: |
When using crontab -e and changing the crontab, I get this error:
It seems recent cronie versions have introduced a feature to create backup files that are saved in ~/.cache/crontab. But it does not check that the ~/.cache directory exists.
The text was updated successfully, but these errors were encountered: