rsync backup-dir with files in read-only folders

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












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.







share|improve this question





















  • I could not find solution for this other than changing adding u+w to the source directory that was read-only and resetting it back with u-w when rsync completes.
    – Sasha
    May 29 at 19:22














up vote
1
down vote

favorite
1












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.







share|improve this question





















  • I could not find solution for this other than changing adding u+w to the source directory that was read-only and resetting it back with u-w when rsync completes.
    – Sasha
    May 29 at 19:22












up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





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.







share|improve this question













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.









share|improve this question












share|improve this question




share|improve this question








edited May 29 at 15:03









Yurij Goncharuk

2,2582521




2,2582521









asked May 29 at 14:35









Sasha

61




61











  • I could not find solution for this other than changing adding u+w to the source directory that was read-only and resetting it back with u-w when rsync completes.
    – Sasha
    May 29 at 19:22
















  • I could not find solution for this other than changing adding u+w to the source directory that was read-only and resetting it back with u-w when rsync completes.
    – Sasha
    May 29 at 19:22















I could not find solution for this other than changing adding u+w to the source directory that was read-only and resetting it back with u-w when rsync completes.
– Sasha
May 29 at 19:22




I could not find solution for this other than changing adding u+w to the source directory that was read-only and resetting it back with u-w when rsync completes.
– Sasha
May 29 at 19:22















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f446716%2frsync-backup-dir-with-files-in-read-only-folders%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f446716%2frsync-backup-dir-with-files-in-read-only-folders%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?