An example rsync script

From PDBWiki

Jump to: navigation, search

A sample rsync script follows;

#!/bin/sh
############################################################################
#
# Script for mirroring PDB FTP archive using rsync
#
############################################################################
 
# This script is being provided to PDB users as a template for using rsync
# to mirror the FTP archive from an anonymous rsync server. You may want
# to review rsync documentation for options that better suit your needs.
 
# You SHOULD CHANGE the next lines to suit your local setup
 
RSYNC=`which rsync`                             # location of local rsync
PROJECTDIR=/project/StruPPi/BiO                 # convenience variable
MIRRORDIR=$PROJECTDIR/DBd/PDB-REMEDIATED        # your top level mirror directory
 
# You SHOULD NOT CHANGE the next two lines
 
SERVER=rsync.wwpdb.org                  # remote server name (dont add ::stuff)
PORT=33444                              # rsync port the remote server is using
 
 
 
## Use the following to GRAB a specific sub directory if necessary
## (dont forget to *exclude* the trailing slash!)...
 
GRAB="."
#GRAB=data/structures/divided/pdb
#GRAB=data/structures/divided/pdb/da
 
$RSYNC $*                                       \
    --delete                                    \
    --archive                                   \
    --verbose                                   \
    --compress                                  \
    --exclude-from=$MIRRORDIR/exclude.list      \
    --port=$PORT                                \
    $SERVER::ftp/$GRAB/                         \
    $MIRRORDIR/$GRAB
Personal tools