I want to run rsync from within WSL and backup my windows copy. (Because the windows tool does not work. If you use it, check your backups! Anyway, so...) I am mounting my backup drive with sudo mount -t drvfs P: /mnt/p and then I use rsync to backup /mnt/c/Users/username/. Though certain directories are read protected and I get permission denied. Is there a way to give rsync (or WSL) the rights to read those files and directories on the windows system?
#!/bin/bash
NAME='Automated-Backup'
LOGSTDERR=/tmp/${NAME}.err
LOGSTDOUT=/tmp/${NAME}.log
sudo mount -t drvfs V: /mnt/v
sudo mount -t drvfs B: /mnt/b
source='/mnt/v/'
target='/mnt/b/Backup'
sudo rsync --delete \
--exclude='*Trash*' \
--exclude='$RECYCLE.BIN' \
--exclude='System Volume Information' \
-aAXzv \
--progress \
$source \
$target 2>${LOGSTDERR} | tee $LOGSTDLOG
cat $LOGSTDERR