Rsync not creating subfolders automatically within same origin and destination paths on different servers

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








up vote
1
down vote

favorite












I am running this rsync via cron hourly to sync my websites automatically to the secondary servers from the primary.



rsync -avz --del -e "ssh -i ~/.ssh/user-key -pXXXXX -o StrictHostKeyChecking=no" /var/www/ USERNAME@IPV4:/var/www/, where XXXXX is a valid port number on the destination server, USERNAME is a valid username with the key file given (present and equal on the primary and all secondary servers), and IPV4 is a valid IPv4 address.



I have another identical command, just with /var/www/ replaced with /etc/nginx/ to sync all nginx configuration files, and that one works as intended. It syncs all subdirectories including their symbolic links. The only difference is in the folder structure and not in the command. The /etc/nginx/ directory contains all of the necessary folders upon nginx's installation, whereas /var/www/ has a subdirectory html/ on all servers (this is part of nginx's installation), but a subdirectory SUBDIR/ that I created on the primary server is not synced via rsync to the destination secondary servers.



In effect, this command needs to be modified somehow so that rsync creates any necessary subdirectories that are new and syncs their entire contents. At the moment, this has broken my website for the time being, at the cost of being more futureproofed for any additional websites I'd like to host on the servers in the future.



Your help is appreciated.



Rsync Noob







share|improve this question




















  • I suspect that the problem is permissions: The way you run rsync does not have the permissions to create a subfolder in /var/www/
    – sudodus
    May 27 at 4:38










  • You should include the output of the failed command in your question.
    – Sebastian Stark
    May 27 at 6:55














up vote
1
down vote

favorite












I am running this rsync via cron hourly to sync my websites automatically to the secondary servers from the primary.



rsync -avz --del -e "ssh -i ~/.ssh/user-key -pXXXXX -o StrictHostKeyChecking=no" /var/www/ USERNAME@IPV4:/var/www/, where XXXXX is a valid port number on the destination server, USERNAME is a valid username with the key file given (present and equal on the primary and all secondary servers), and IPV4 is a valid IPv4 address.



I have another identical command, just with /var/www/ replaced with /etc/nginx/ to sync all nginx configuration files, and that one works as intended. It syncs all subdirectories including their symbolic links. The only difference is in the folder structure and not in the command. The /etc/nginx/ directory contains all of the necessary folders upon nginx's installation, whereas /var/www/ has a subdirectory html/ on all servers (this is part of nginx's installation), but a subdirectory SUBDIR/ that I created on the primary server is not synced via rsync to the destination secondary servers.



In effect, this command needs to be modified somehow so that rsync creates any necessary subdirectories that are new and syncs their entire contents. At the moment, this has broken my website for the time being, at the cost of being more futureproofed for any additional websites I'd like to host on the servers in the future.



Your help is appreciated.



Rsync Noob







share|improve this question




















  • I suspect that the problem is permissions: The way you run rsync does not have the permissions to create a subfolder in /var/www/
    – sudodus
    May 27 at 4:38










  • You should include the output of the failed command in your question.
    – Sebastian Stark
    May 27 at 6:55












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am running this rsync via cron hourly to sync my websites automatically to the secondary servers from the primary.



rsync -avz --del -e "ssh -i ~/.ssh/user-key -pXXXXX -o StrictHostKeyChecking=no" /var/www/ USERNAME@IPV4:/var/www/, where XXXXX is a valid port number on the destination server, USERNAME is a valid username with the key file given (present and equal on the primary and all secondary servers), and IPV4 is a valid IPv4 address.



I have another identical command, just with /var/www/ replaced with /etc/nginx/ to sync all nginx configuration files, and that one works as intended. It syncs all subdirectories including their symbolic links. The only difference is in the folder structure and not in the command. The /etc/nginx/ directory contains all of the necessary folders upon nginx's installation, whereas /var/www/ has a subdirectory html/ on all servers (this is part of nginx's installation), but a subdirectory SUBDIR/ that I created on the primary server is not synced via rsync to the destination secondary servers.



In effect, this command needs to be modified somehow so that rsync creates any necessary subdirectories that are new and syncs their entire contents. At the moment, this has broken my website for the time being, at the cost of being more futureproofed for any additional websites I'd like to host on the servers in the future.



Your help is appreciated.



Rsync Noob







share|improve this question












I am running this rsync via cron hourly to sync my websites automatically to the secondary servers from the primary.



rsync -avz --del -e "ssh -i ~/.ssh/user-key -pXXXXX -o StrictHostKeyChecking=no" /var/www/ USERNAME@IPV4:/var/www/, where XXXXX is a valid port number on the destination server, USERNAME is a valid username with the key file given (present and equal on the primary and all secondary servers), and IPV4 is a valid IPv4 address.



I have another identical command, just with /var/www/ replaced with /etc/nginx/ to sync all nginx configuration files, and that one works as intended. It syncs all subdirectories including their symbolic links. The only difference is in the folder structure and not in the command. The /etc/nginx/ directory contains all of the necessary folders upon nginx's installation, whereas /var/www/ has a subdirectory html/ on all servers (this is part of nginx's installation), but a subdirectory SUBDIR/ that I created on the primary server is not synced via rsync to the destination secondary servers.



In effect, this command needs to be modified somehow so that rsync creates any necessary subdirectories that are new and syncs their entire contents. At the moment, this has broken my website for the time being, at the cost of being more futureproofed for any additional websites I'd like to host on the servers in the future.



Your help is appreciated.



Rsync Noob









share|improve this question











share|improve this question




share|improve this question










asked May 27 at 1:37









Rsync Noob

162




162











  • I suspect that the problem is permissions: The way you run rsync does not have the permissions to create a subfolder in /var/www/
    – sudodus
    May 27 at 4:38










  • You should include the output of the failed command in your question.
    – Sebastian Stark
    May 27 at 6:55
















  • I suspect that the problem is permissions: The way you run rsync does not have the permissions to create a subfolder in /var/www/
    – sudodus
    May 27 at 4:38










  • You should include the output of the failed command in your question.
    – Sebastian Stark
    May 27 at 6:55















I suspect that the problem is permissions: The way you run rsync does not have the permissions to create a subfolder in /var/www/
– sudodus
May 27 at 4:38




I suspect that the problem is permissions: The way you run rsync does not have the permissions to create a subfolder in /var/www/
– sudodus
May 27 at 4:38












You should include the output of the failed command in your question.
– Sebastian Stark
May 27 at 6:55




You should include the output of the failed command in your question.
– Sebastian Stark
May 27 at 6:55










1 Answer
1






active

oldest

votes

















up vote
1
down vote













Issue was permissions. I had not run the additional command to change ownership and group of /var/www even though permissions were coming up correct in my FTP client.






share|improve this answer




















  • Thanks for sharing your solution :-) Please make sure that the modified permissions do not open a security hole in your server.
    – sudodus
    May 28 at 4:33










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
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: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2faskubuntu.com%2fquestions%2f1040740%2frsync-not-creating-subfolders-automatically-within-same-origin-and-destination-p%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













Issue was permissions. I had not run the additional command to change ownership and group of /var/www even though permissions were coming up correct in my FTP client.






share|improve this answer




















  • Thanks for sharing your solution :-) Please make sure that the modified permissions do not open a security hole in your server.
    – sudodus
    May 28 at 4:33














up vote
1
down vote













Issue was permissions. I had not run the additional command to change ownership and group of /var/www even though permissions were coming up correct in my FTP client.






share|improve this answer




















  • Thanks for sharing your solution :-) Please make sure that the modified permissions do not open a security hole in your server.
    – sudodus
    May 28 at 4:33












up vote
1
down vote










up vote
1
down vote









Issue was permissions. I had not run the additional command to change ownership and group of /var/www even though permissions were coming up correct in my FTP client.






share|improve this answer












Issue was permissions. I had not run the additional command to change ownership and group of /var/www even though permissions were coming up correct in my FTP client.







share|improve this answer












share|improve this answer



share|improve this answer










answered May 27 at 15:23









Rsync Noob

162




162











  • Thanks for sharing your solution :-) Please make sure that the modified permissions do not open a security hole in your server.
    – sudodus
    May 28 at 4:33
















  • Thanks for sharing your solution :-) Please make sure that the modified permissions do not open a security hole in your server.
    – sudodus
    May 28 at 4:33















Thanks for sharing your solution :-) Please make sure that the modified permissions do not open a security hole in your server.
– sudodus
May 28 at 4:33




Thanks for sharing your solution :-) Please make sure that the modified permissions do not open a security hole in your server.
– sudodus
May 28 at 4:33












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1040740%2frsync-not-creating-subfolders-automatically-within-same-origin-and-destination-p%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

Trouble downloading packages list due to a “Hash sum mismatch” error

How do I move numbers in filenames, in a batch renaming operation?