Author Topic: phpDVDProfiler & rSync  (Read 5271 times)

Touti

  • Guest
phpDVDProfiler & rSync
« on: October 02, 2009, 10:56:40 PM »
I will get rid of my VPS soon and move my sites to a shared hosting account at Hostgator.  I can host as many sites as I want (using add-on domains) but I have only one cPanel and SSH account.  I want to keep hosting Jimmy's collection but I don't want him to have to use FTP to upload a 20+ megs xml file and all the images every time he adds something to his collection.

I don't know much about rSync except that it was very hard for me to get it to work with my VPS so I'm wondering, is it possible that we both use it to sync our files in separate folders ? 

RossRoy

  • Guest
Re: phpDVDProfiler & rSync
« Reply #1 on: October 02, 2009, 11:00:07 PM »
Security considerations aside, as long as Jimmy's rsync script is configured to update the right folder in the host, there shouldn't be a problem..

For instance, I use Site5, and for each subdomain and/or domain, a new folder is created in my public_html folder, each representing a single subdomain. Just make sure Jimmy changes the destination folder in his script and everything should be fine.

Touti

  • Guest
Re: phpDVDProfiler & rSync
« Reply #2 on: October 02, 2009, 11:10:31 PM »
So I guess there's no way this can be done over a FTP connection right ?  rSync will only work through an SSH connection ?

It's not really a problem actually since it's only a shared hosting account, I wouldn't give the root password of my VPS to anyone but I really don't see any problems by giving Jimmy my login details on my new hosting account.  I don't think he would have much interest in hacking my phpDVDProfiler site  ;D

Touti

  • Guest
Re: phpDVDProfiler & rSync
« Reply #3 on: October 02, 2009, 11:50:00 PM »
Is anyone using rsync on a 64 bit windows ?  I can't get the batch file to run under Windows 7 64, I get an error on running something called sbs2.com which is a 16 bit program.

RossRoy

  • Guest
Re: phpDVDProfiler & rSync
« Reply #4 on: October 02, 2009, 11:56:20 PM »
sbs2.com is the magical com files that is generated by the rsync bat file to automagically transfer \ to / in order for rsync to understand the file path correctly.. I don't think anything can be done about that.. You could hunt down an older version and use cygwin style folder names (cygdrive/c/users/.../dvd profiler/databases/... instead of c:\users\...\dvd profiler\databases\).. you'd have more luck asking Andy about that on the phpdvdp forums.. assuming he still reads them.

AFAIK, Rsync will only work through SSH. But you could check with the hosting. Maybe you can create specific Rsync "shares" that would be accessible only to a specific security certificate that Jimmy would have on his computer.

Touti

  • Guest
Re: phpDVDProfiler & rSync
« Reply #5 on: October 03, 2009, 12:06:52 AM »
I'll have to check about the rsync share, I'm not sure I know what you mean.  And frankly I doubt that hostgator will do anything to help me circumvent their limitations, they will most probably tell me to take a reseller account if that's what I need.

As for my 64 bits problems I'm just gonna workaround it by running rsync in a virtual xp.

Offline Achim

  • Mega Heavy Poster
  • *******
  • Posts: 7179
  • Country: 00
    • View Profile
Re: phpDVDProfiler & rSync
« Reply #6 on: October 05, 2009, 12:09:15 AM »
I am in no way an expert and have previously been walked through setting this up myself. However, there is no need for you to give Jimmy your login details. I think he won't even have to give you a new public key for rsync, provided you still have the one he previously gave you. It's you who has to merge that one into the key-file on your server.

deadman(36g) used to use rsync to update his collection on my server (it's still there, he just doesn't update it anymore) and he never needed to login into my account. I just created a folder for him, assigned a quota and merged the key. Done. ...well, I also had to teach him how to create and use the rsync script.

The guy who taught me is ajm, owner of the phpdvdprofiler forum, but he has not been active in quite some time and only logs into his site every few months.

Touti

  • Guest
Re: phpDVDProfiler & rSync
« Reply #7 on: October 06, 2009, 07:37:53 PM »
I was having too many problems with the shared hosting account so I decided to keep things as they are for the server.  Now I'm trying to finish the rsync setup which I haven't used in a long time (since I started selling my collection about a year ago) and I'm having a problem I can't figure out.

My computer is running Windows 7 64 Bits which parts of the batch file doesn't work on (because of the 64 bits, not because of Windows 7) so I'm running this from a Virtual Windows XP.

In my Virtual XP I mapped the Z drive to the C drive of the my real machine.  The paths to my files are:

SET COL=Z:\collection.xml
SET IMAGES=Z:\Users\Eric Gagne\Documents\DVD Profiler\Databases\Default\Images

Both paths are good and in Explorer in the Virtual machine I can navigate all the way to my Images folder, I also tried creating a text file there from Explorer and it allowed me so I know I have full permissions.

Yet, when I run the batch files the xml files is uploaded but the images don't get synchronized and I have a permissions error message.

Does anyone have any idea why I would get a permission error on reading files in a folder that I have access to ?

« Last Edit: October 06, 2009, 07:39:30 PM by Eric »

Touti

  • Guest
Re: phpDVDProfiler & rSync
« Reply #8 on: October 06, 2009, 08:19:12 PM »
I've installed DVDP on the virtual machine and changed the paths to

SET COL=C:\collection.xml
SET IMAGES=c:\Documents and Settings\Eric Gagne\my Documents\DVD Profiler\Databases\Default\Images

and now it's working so my guess is that the readdir function in rSync doesn't support network/mapped drives.

RossRoy

  • Guest
Re: phpDVDProfiler & rSync
« Reply #9 on: October 06, 2009, 08:45:31 PM »
Don't know if you want to further test it.. but have you tried setting the share from the Batch file with NET USE ?

I've had to work with some tools that wouldn't take shares create in Explorer.. I had to define them in the batch file fir them to be recognized. Maybe something similar is happening with cygwin/rsync

Touti

  • Guest
Re: phpDVDProfiler & rSync
« Reply #10 on: October 06, 2009, 09:02:14 PM »
It's a good idea Seb, I'm gonna try that.

Touti

  • Guest
Re: phpDVDProfiler & rSync
« Reply #11 on: October 06, 2009, 09:20:02 PM »
That didn't fix the problem but as I was trying the "net use" command I remembered something that I found about Windows 7 about 2 weeks ago.

The directory structures for user files is C:\Users\<USER NAME>\Documents but physically on disc this path doesn't exist.  The old XP/Vista structure of C:\Documents and Settings\<USER NAME>\My Documents is still there but they're all hidden directories.  The nes structure seems to be some kind of pointers or virtual names.

When I tried from Explorer in my Virtual XP to navigatore (by typing it in the address bar) to C:\Documents and Settings\Eric Gagne\My Documents\DVD Profiler\Databases\Default\Images I got error messages that the access was denied.

I'm pretty sure now that when the Virtual XP tries to access C:\Users\Eric Gagne\Documents it's redirected by Windows 7 to C:\Documents and Settings\Eric Gagne\My Documents which is hidden and to which the Virtual XP user doesn't have any rights.

I may be able to workaround the problem by fooling with security settings on that hidden folder but it doesn't like a very good idea to me.  I'm don't know if I want to risk messing up my Windows 7 when an easy solution would simply be to run DVDP in a the Virtual machine altogether.


Touti

  • Guest
Re: phpDVDProfiler & rSync
« Reply #12 on: October 06, 2009, 10:09:03 PM »
Nothing I tried so far works.  I searched a bit on internet and it seems that rSync started having permission problems with Vista.  Apparently Microsoft changed something in the way permissions work in Vista (and therefore Win 7) and rSync can't handle them anymore.

However I just came up with a simple solution.  I'm gonna create a "images" folder in the root of my Virtual machine and add a command at the top of the batch file to xcopy everything from z:\images to C:\images.  Then I just need to set my images directory to c:\images and that should do it.


RossRoy

  • Guest
Re: phpDVDProfiler & rSync
« Reply #13 on: October 06, 2009, 10:12:26 PM »
Whatever works! As my "boss:client" would say - Mieux vaut un système boiteux, que pas de système du tout!  :laugh:

And for our non-french-speaking friends: Better to have an underperforming system, than no system at all!

Touti

  • Guest
Re: phpDVDProfiler & rSync
« Reply #14 on: October 06, 2009, 10:25:42 PM »
Fortunately xcopy has a few nice parameters, this command did the trick.

xcopy "\\tsclient\C\Users\Eric Gagne\My Documents\DVD Profiler\Databases\Default\images\*.*" "c:\program files\cwrsync\images" /s /D /Q

I decided to put my images in the same directory as rsync finally, I don't like having too much stuff in the root.

/S Include sub-directories (for thumbnails)
/D Copy only files which the last date is newer (saves from copying hundreds of files every time)
/Q Quiet mode (doesn't display the name of each file)

Now if I could just find a way to add a shortcut on my Windows 7 directly to the batch file in the Virtual machine that would perfect, I wouldn't even have to start and start the VM manually.  With Windows 7 XP Mode there's a shortcut in the start menu for programs that are installed in the VM, it allows to run them in XP mode but directly from Windows 7 without having the desktop and everything that comes with the virtual machine.  I'll see if I can trace the syntax of their shortcut and create one to the batch file :)