edit: I was so used to seeing an “inaccecible” error message that I didn’t catch the tail end of this message until it was posted on a forum. (Stupid tiny screen!) However, a thread is still needed since there is still an error message that shouldn’t be so I fixed this post accordingly.
I wrote a backup script for my desktop which, in theory work on my tablet under Termux. However, reality is having none of it.
Fatal: unable to save snapshot: fs.TempFile: open /data/data/com.termux/files/usr/tmp/restic-tmp/restic-temp-pack-4233175164: no such file or directory
For my main script, that is always thrown. I’ve tried constructing a minimal working example, but the fact of the matter is, sometimes it works and sometimes it doesn’t. I’m not sure what the source of the problem is since the directory does exist and I can’t know the exact file name for the pack ahead of time.
#!/data/data/com.termux/files/usr/bin/env -S clojure -M
(require '[clojure.java.shell :refer [sh]])
(def env {"RESTIC_REPOSITORY" "test/local"
"RESTIC_PASSWORD" "1"
"RESTIC_CACHE_DIR" "/data/data/com.termux/files/usr/tmp/restic-cache"
"TMPDIR" "/data/data/com.termux/files/usr/tmp/restic-tmp"})
(println (sh "restic" "backup" "./src" :env env))
It written in Clojure, but it is very simple and intended to run on it’s own. I did this to isolate it from the build environment. (The ~/.clojure/profile.edn file is basically empty in that it has no deps specified.)
There’s no OS specific code, so this should work just as well on my tablet as my desktop.
$ restic version
restic 0.14.0 compiled with go1.19 on android/arm64
It’s probably worth mentioning that a similiar Bash script does not have this issue, so presumably this has at least something to do with the JVM. However, this is the only error message I’m getting, so this is where I’m starting.