Overview

Server Map:

  [mirror] --pull from-- [original]
  [mirror] --push to  -- [target]

--[001: Quick Hack: Linux Way]--
0. setup new account
    - create new user on mirror site
     adduser --disabled-login mirror
     su mirror
     cd ~
    - setup account on push site
1. setup SSH key for new account
    ssh-keygen -t rsa -b 4096
   - add public part to push site
2. do the first clone
    hg clone https://.../... <project>
3. setup push site
    vim <project>/.hg/hgrc
   - add default-push to [paths]
3. create shell script
    cd ~
    vim sync.sh
      WD=/home/mirror/<project>
      /usr/bin/hg --cwd $WD pull
      /usr/bin/hg --cwd $WD push
    chmod +x sync.sh
4. setup cron job
   - make sure using full path to shell script
   - hardcode sync every hour at 45th minute
      crontab -e
       45 *    * * *   /home/mirror/sync.sh