So at my new (old) job (long story) I have to work on Windows 7, which isn’t terrible, but some of the things I had been forced to work out are things that are just there in linux, or work a hell of a lot better in Linux. A great example is file syncing between my dev box, and my testing environment.
The initial setup was to use Samba to create a local connection so I could copy files over to the test environment. This is fine except a lot of my projects are in the 1000s of files, and Samba gets a but stupid when you get past a few hundred files. So that sucked.
First Fix: PSCP
So if you use Windows and you have to work with a linux box you have probably come to know and love (or loath) PuTTY. Did you know that PuTTY has a SCP client?! Yeah, me neither, but it does.
It was kinda easy to use, once I read all the docs and played with it for a min, but it was SCP, I was just copying files and copying files and copying files. With 17,000+ files in just one of my projects this is not really a great concept to just keep pushing 17,000+ files every few minutes.
I need to find deltas, or incremental changes. I need rsync.
Fix #2: cwRsync
cwRsync is a cygwin + rsync package for windows. Again it took some playing with to get it setup properly (and I am still having a permissions problem) but I can not copy only the files that have changed.
This means instead of editing 10 files and then transferring 17,000 files (cause I am lazy to hunt down each file and copy it) I can now edit the 10 files, run an rsync command and only the 10 files are updated. Beautiful!
The New Problem:
The only problem I am having now is that my rsync is setting the permissions on the server as rwx—— (or… owner can do anything, and no one else can do anything). This is a problem as the owner is my user account and not the webserver, and the webserver is the group, and the group is not getting any read permissions.
So I need to find a post rsync hook, add a cron (to chmod?) or simply (and what I am doing now) is updating the permissions by hand.
If you have a suggestion, feel free to leave it in the comments.
0