I am using rsync over ssh to backup directory structure. In that structure there is read-only folder with a few writable folders within. Content in these writable folders does change and needs to be backed up.
The main backup process works fine, but "backup of backup" (--backup --backup-dir
) fails for folders in read-only folder with:
rsync: mkdir failed - permission denied
This is rsync
command:
rsync -e "ssh -i some_key_file.pub -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
--backup --backup-dir=backup_dir --force --ignore-errors --delete -a root_folder server:destination_folder/
This is folder structure:
root_folder
-- read_only_folder
---- writable_folder
Rsync fails creating backup_dir/read_only_folder/writable_folder
.
Because the main part of the backup does work (I assume rsync
adjusts permission after syncing files), I am thinking that I am just missing something that would apply the same to the --backup-dir
files.