Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

staticpublisher rsync problem


Go to End


3 Posts   2393 Views

Avatar
bschmitt

Community Member, 22 Posts

3 February 2009 at 11:49am

Hi!

First of all I would like to congrat you for a really great CMS!

My question belongs to the "staticpublisher": http://doc.silverstripe.com/doku.php?id=staticpublisher#multiple_server_caching
I've tried to get this working with a cms server and a live server. Both have ssh access and rsync installed.

Here is my current config within _config.php: (webmin a user of the live server whom has access to the web dir)

Object::add_extension("SiteTree", "RsyncMultiHostPublisher('cache/', 'html')");
RsyncMultiHostPublisher::set_targets(array(
'webmin@myServer.de:/var/www/silverstripetest'
));

Where to put the password?

After dev/buildcache?flush=1 the output says == Done! ==, but sadly no data has been transfered to the live-server.

Has someone an idea why?

Many thanks and best regards,
Bjoern

Avatar
Ingo

Forum Moderator, 801 Posts

5 February 2009 at 9:22am

Hey Björn, you're right, currently RSyncMultiHostPublisher doesn't support password authentication - it relies on key-based authentication for the selected user. I've opened a new enhancement ticket for supporting password auth as well: http://open.silverstripe.com/ticket/3488

As for your publishing problems, can you confirm that the rsync command in RsyncMultiHostPublisher->publishPages() is actually fired?

Avatar
bschmitt

Community Member, 22 Posts

5 February 2009 at 11:44am

Hi Ingo!

Thanks for the quick replay. Yes I can confirm, that the publishPages() get fired but not the rsync command.

This is the loop of the rsync command:

foreach(self::$targets as $target) {
  // Transfer non-PHP content from everything to the target; that will ensure that we have all the JS/CSS/etc
  $rsyncOutput = `cd $base; rsync -av -e ssh --exclude /.htaccess --exclude '*.php' --exclude '*.svn' --exclude '*~' --delete . $target`;
  // Then transfer "safe" PHP from the cache/ directory
  $rsyncOutput .= `cd $base; rsync -av -e ssh --exclude '*.svn' --exclude '*~' --delete cache $target`;
  if(StaticPublisher::echo_progress()) echo $rsyncOutput;
}

It seemed to me that the

`…`
is incorrect as well as the
echo $rsyncOutput;
?

After changing this to

echo system($rsyncOutput);
and doing the ssh access via public keys I'm able to transfer :-)

Many thanks and best regards,
Björn