I have had a Python script automating backups (and forgetting/pruning) which has been working on my W10 system for years now. Every 10 minutes a recurrent task runs. This involves doing “restic snapshots” to a repository on an internal drive (drive E:) and to another repository an external drive (drive F:). Drive F: only bothers with hourly/daily/weekly/monthly backups, but drive E: also records 10-minute snapshots.
I’m getting ready to move all my machines to Linux OS (Linux Mint 22.2) so I’ve been adapting this script to work in both W10 and Linux. Things now seem to be working OK on the E: drive repo (in W10) … but something is stopping the F: drive snapshots happening properly.
I can do a manual backup thus:
> restic -r "F:\Backups\restic\My documents" --verbose -p "D:\My documents\sysadmin\resources\restic\my_documents_pwd.txt" backup --tag hour "D:/My Documents"
… and it works OK.
NB when done programmatically the adding/removal of tags (“hour”, “day”, etc.) is handled after the backup completes. Snapshots with no tags eventually get forgotten/pruned.
But my recurrent script is having problems: this log message shows what parameters I’m passing to subprocess.run():
2025-12-29 16:00:06.450 - [sysadmin] - ERROR restic_backup_task [src\recurrent2\restic_backup_task.py 292]:
ERROR. restic backup.
cmd was |['D:/apps/restic/restic_0.14.0/restic', '-r', WindowsPath('f:/Backups/restic/My Documents'), '--verbose', '-p', WindowsPath('D:/My Documents/sysadmin/Resources/restic/my_documents_pwd.txt'), 'backup', '--json', '--use-fs-snapshot', WindowsPath('D:/My Documents')]|
stderr |{"message_type":"error","error":{},"during":"archival","item":"d:\\"}
stack trace File "D:\My documents\software
That message from stderr comes from restic.
Anyway, I’m just wondering if someone has any idea what might be causing this restic error outputting “during .. archival .. item .. d:\\”? There are a couple of posts in this forum mentioning “during .. archival” but having examined them I don’t think I can learn much.
I’m wondering whether the fact that I’m using forward slashes as path separators (rather than backslash, official separator for Windows) might have something to do with it. Previously I was using backslashes, but as part of the process of “unifying” for use in Linux and W10 I switched everything to forward slashes. In theory W10 should be able to cope with this so it seems unlikely. Also this would surely affect snapshots to the E: drive as well, but they’re working fine.
I’m wondering what “item” .. “d:\\” might mean. Could this be some anomalous blob that’s somehow got snarled up in the F: drive repository? What might I do about that?
Later
I decided to rename the directory with the restic repo on the F: drive and initiate a new one. The first (automated i.e. programmatic) “restic backup” to it appears to have worked OK: “restic snapshots” shows that this first snapshot has been given the tags “hour”, “day”, “week”, “month” and “year”, which is how it’s meant to work.
Later
… Aaagh … next time it had to do a snapshot and tag it “hour” (i.e. one hour later) … that same error occurred in the same circumstances (“restic backup”):
stderr |{"message_type":"error","error":{},"during":"archival","item":"d:\\"}
|
… however, I can also see that there are now many snapshots without tags when I run “restic snapshots” on this F: drive repo. But that error definitely occurred on “restic backup”. This error outcome will have caused the “tag management” part of my script not to be run. But the next thing to try is probably to ignore this error and carry on to the next part of the script, tag management. Still like to have some idea of what this error means …