Hi,
I’m redoing all my machines backups from fresh after issues with memory going bad on two different machines
It’s made me realize why I’ve had a long running problem with some chunks in my storage being owned by root when they should be owned by duplicacy.
I backup my computers using duplicacy cli over sftp to a chroot jail on my home server. The sftp connection uses a specific user on the server: ‘duplicacy’ so any chunks and snapshots uploaded over sftp are owned by the duplicacy user.
I also backup one zfs pool to my shared storage on the server directly. ssh in, switch to root and ‘duplicacy backup --stats’ - now any uploaded chunks and snapshots are owned by root.
Now if duplicacy over sftp wants access to a chunk owned by root on the server I get an error. Easily corrected by chown-ing the relevant chunk to duplicacy:duplicacy and rerunning the backup. Still a bit of a pain though.
So the question is: how can I do a local backup to this shared storage whilst being root (for the required filesystem access) but have the chunks and snapshots written as the duplicacy user?
One obvious workaround is just to script this local backup and have it automatically correct the permissions once duplicacy has finished its work. But is there a more elegant solution?