Tuesday, October 27, 2009

Running cron in cygwin

I setup my cron job in cygwin today. The correct way to start the cron
daemon is using the /usr/bin/cron-config tool that comes with the cron
package. You can choose to run cron daemon with you own user account
or as a SYSTEM account process. The difference is explained in
/usr/share/doc/Cygwin/cron-VERSION.README. I chose to run cron
as SYSTEM process. This gave me a bit trouble. Because the job spec
I edited is owned by my own user account. The cron daemon process
cannot load a crobtab file with different owner than its process owner.
(Maybe not correct, but once I change my crontab file to be owned by
SYSTEM, it worked). I got this fixed by using the cronevents.exe tool,
which is really really helpful. Also, you might want to cron_diagnose.sh
script to check if various configuration is correct, such as the /var dir's
permission.

Svn repository mirror using svnsync

Because my company's main svn repo is in a different city, we constantly
suffer from the slow network during development. The idea of setting up
a read-only mirror has come to my mind for a long time. But I haven't had
the time to implement it. Today, I spent half a day to set it up finally.

Here is the note to record what I read and did to make it work:

  1. Read this post It tells almost everything you need to know to set it up, of course, you need to have some basic svn knowledge.
  2. For me the sync was not working due to failing the acquire a write-lock. The error message is: "svnsync: Can't open file '/var/svn/pim_12_mirror/db/write-lock':Permission denied". I fix it by chowning everything under the repo to be owned by svn user.
  3. Because the mirror is read-only. Using 'svn switch' sub-command will greatly help you to get the best of the mirror while being able to commit the original repo.