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

Clash 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
filesystem directory nginx webserver rsync
add a comment |Â
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
filesystem directory nginx webserver rsync
I suspect that the problem is permissions: The way you runrsyncdoes 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
add a comment |Â
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
filesystem directory nginx webserver rsync
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
filesystem directory nginx webserver rsync
asked May 27 at 1:37
Rsync Noob
162
162
I suspect that the problem is permissions: The way you runrsyncdoes 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
add a comment |Â
I suspect that the problem is permissions: The way you runrsyncdoes 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
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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.
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I suspect that the problem is permissions: The way you run
rsyncdoes 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