rsync usage sample scripts

backup to a central backup server with 7 day incremental


#!/bin/sh

# This script does personal backups to a rsync backup server. You will end up
# with a 7 day rotating incremental backup. The incrementals will go
# into subdirectories named after the day of the week, and the current
# full backup goes into a directory called "current"
# tridge@linuxcare.com

# directory to backup
BDIR=/home/$USER

# excludes file - this contains a wildcard pattern per line of files to exclude
EXCLUDES=$HOME/cron/excludes

# the name of the backup machine
BSERVER=owl

# your password on the backup server
export RSYNC_PASSWORD=XXXXXX


########################################################################

BACKUPDIR=`date +%A`
OPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES
--delete --backup --backup-dir=/$BACKUPDIR -a"

export PATH=$PATH:/bin:/usr/bin:/usr/local/bin

# the following line clears the last weeks incremental directory
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
rsync --delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/
rmdir $HOME/emptydir

# now the actual transfer
rsync $OPTS $BDIR $BSERVER::$USER/current

backup to a spare disk


I do local backups on several of my machines using rsync. I have an
extra disk installed that can hold all the contents of the main
disk. I then have a nightly cron job that backs up the main disk to
the backup. This is the script I use on one of those machines.

#!/bin/sh

export PATH=/usr/local/bin:/usr/bin:/bin

LIST="rootfs usr data data2"

for d in $LIST; do
mount /backup/$d
rsync -ax --exclude fstab --delete /$d/ /backup/$d/
umount /backup/$d
done

DAY=`date "+%A"`

rsync -a --delete /usr/local/apache /data2/backups/$DAY
rsync -a --delete /data/solid /data2/backups/$DAY



The first part does the backup on the spare disk. The second part
backs up the critical parts to daily directories. I also backup the
critical parts using a rsync over ssh to a remote machine.


mirroring vger CVS tree


The vger.rutgers.edu cvs tree is mirrored onto cvs.samba.org via
anonymous rsync using the following script.

#!/bin/bash

cd /var/www/cvs/vger/
PATH=/usr/local/bin:/usr/freeware/bin:/usr/bin:/bin

RUN=`lps x | grep rsync | grep -v grep | wc -l`
if [ "$RUN" -gt 0 ]; then
echo already running
exit 1
fi

rsync -az vger.rutgers.edu::cvs/CVSROOT/ChangeLog $HOME/ChangeLog

sum1=`sum $HOME/ChangeLog`
sum2=`sum /var/www/cvs/vger/CVSROOT/ChangeLog`

if [ "$sum1" = "$sum2" ]; then
echo nothing to do
exit 0
fi

rsync -az --delete --force vger.rutgers.edu::cvs/ /var/www/cvs/vger/
exit 0

Note in particular the initial rsync of the ChangeLog to determine if
anything has changed. This could be omitted but it would mean that the
rsyncd on vger would have to build a complete listing of the cvs area
at each run. As most of the time nothing will have changed I wanted to
save the time on vger by only doing a full rsync if the ChangeLog has
changed. This helped quite a lot because vger is low on memory and
generally quite heavily loaded, so doing a listing on such a large
tree every hour would have been excessive.


automated backup at home


I use rsync to backup my wifes home directory across a modem link each
night. The cron job looks like this

#!/bin/sh
cd ~susan
{
echo
date
dest=~/backup/`date +%A`
mkdir $dest.new
find . -xdev -type f \( -mtime 0 -or -mtime 1 \) -exec cp -aPv "{}"
$dest.new \;
cnt=`find $dest.new -type f | wc -l`
if [ $cnt -gt 0 ]; then
rm -rf $dest
mv $dest.new $dest
fi
rm -rf $dest.new
rsync -Cavze ssh . samba:backup
} >> ~/backup/backup.log 2>&1


note that most of this script isn't anything to do with rsync, it just
creates a daily backup of Susans work in a ~susan/backup/ directory so
she can retrieve any version from the last week. The last line does
the rsync of her directory across the modem link to the host
samba. Note that I am using the -C option which allows me to add
entries to .cvsignore for stuff that doesn't need to be backed up.

Fancy footwork with remote file lists

One little known feature of rsync is the fact that when run over a
remote shell (such as rsh or ssh) you can give any shell command as
the remote file list. The shell command is expanded by your remote
shell before rsync is called. For example, see if you can work out
what this does:

rsync -avR remote:'`find /home -name "*.[ch]"`' /tmp/

note that that is backquotes enclosed by quotes (some browsers don't
show that correctly).

Everlasting

Verse 1:


C

G


Th

e sky will fall


Am

F


The

ground will give


C

G


Th

rough it all You will


Am

F


be

faithful


C

G


Fr

iends may leave


Am

F


The

y come and go


C

G


Th

is I know


Am

F


You

will be faithful


Am

F


You

will be faithful



Chorus:


C

G

Am


Yo

u

will always be the same


F

C


Yo

ur love will never change


G

Am

F


Yo

u a

re the everlasting


C

G

Am


I

wi

ll put my trust in You


F

C


Fo

rever to be true


G

Am

F


Yo

u a

re the everlasting


G

Am

F


Yo

u a

re the everlasting



Verse 2

When beauty fades

And slips away

For all my days You will

be faithful

When I breathe `

My final breath

I find my rest in Your

Faithfulness



Bridge:

Dm G (x3)

When all around us

Is falling into waste

When the earth is dying

You cannot be erased

And I don't have to be afraid

You're the Alpha and Omega

You're forever, everlasting


Cry Holy


Verse:

E A
Every sun and moon and star
C#m
All declaring who You are
A
We fall silent in amazement
E A
Every word and deed of man
C#m
Every sea and grain of sand

All creation speaks
B
And now we sing to proclaim Your majesty


Chorus:
A E
Let the earth rejoice
B
Singing with one voice

Let the people cry
C#m
Holy Holy Lord
A E
Every creature sing
B
Praises to the king
F#m
All creation cry
E
Holy is the Lord

A - E - C#m - A



Verse:

E A
Every song sung on the earth
C#m
Will never capture all your worth
A
We fall silent in amazement
E A
Let every humble heart now see
C#m
The beauty of Your majesty

All creation speaks
B
And now we sing to the King above all kings

Resonate

Chords:
D2: x00230
Dmaj9: x00220 (dont know what this chord is really called)
D/F#: 200232
E: 022100
G2: 3x0203
Bm: x24432
Asus: x02230
Em7: 022030
F#7: x44320


Capo 1

Intro: D2 Dmaj9 D2 Dmaj9 G2 (x2)

Bm Asus
Let the sea resound, let every knee bow down
Em7
We will praise You, we will praise You
Bm Asus
Let every tongue confess of Your righteousness
Em7 Bm E
We will praise You, we will praise You


Bm Asus
Let the mountains ring with praises to our King
Em7
We will worship! We will worship!
Bm Asus
Let the skies proclaim what Your hands have made
Em7 G2
We will worship You!

Chorus:
D2 Dmaj9 D2 Dmaj9
Let all nature sing; let the earth rejoice
G2
We will resonate, resonate Your glory
D2 Dmaj9 D2 Dmaj9
Let all living things praise You with one voice
G2 D2 Dmaj9 D2 Dmaj9 G2
We will resonate, resonate Your glory

Bm Asus
Let the rocks cry out, let the children shout
Em7
We will worship! We will worship!
Bm Asus
Let the waters roar praise You forevermore
Em7 G2
We will worship You!

Chorus:

Bridge:
Bm A F#7
Let songs of joy, fill the air
Bm A G2
Your praises echo everywhere
D/F# G2
From oceans deep, to the sky
A Em7 Bm D2 Dmaj9 D2 Dmaj9 G2
Let all things praise You Lord Most High!


SonicFlood

Sonicflood official WEBSITE

"Music was created by God, as was every instrument, to be used to bring Him glory. We are commanded in the New Testament to 'sing and make melody with all our heart to the Lord and to address each other in psalms, hymns and spiritual songs' (Col. 3:16 and Eph. 5:19).”—Rick Heil, SONICFLOOd

It is this desire and belief that is central to the life and ministry of the Grammy-nominated worship band SONICFLOOd.

Having released eight albums since their debut in 1999, sold over two million records, and received numerous Dove awards and a Grammy nomination, SONICFLOOd’s brand of modern worship—including the hits “I Could Sing of Your Love Forever,” “Cry Holy,” and “Resonate,”—has made a major impact on worshippers all over the world. This impact and extensive coverage is sure to continue and grow with the band's new album, due out in 2008 on their own label, Resonate Records.
SONICFLOOd’s new release is a collection of love songs to The Creator of the Universe. “This album has found us on a journey of love to the Father’s heart. He never fails to reveal more of Himself as we press in to Him through our songs of praise,” states Heil. The album’s songs range from a corporate call to worship to the honest introspective song of confession. The song “You” speaks of the fear and grace that come when we try to completely open ourselves up to the Holy One. “Look To Love” is a song that encourages people to live passionate lives for Jesus and the song “Psalm 46” calls us to remember that The Lord is our ever-present help in every situation.

While excited to bring this new music to people here in the United States, SONICFLOOd remains committed to spreading God’s Word internationally, as well. To date, the band has toured India, Australia, the Bahamas, Brazil, Canada, Malaysia, Mexico, Northern Ireland, Singapore, South Africa, Switzerland, Thailand, Turkey and the United Kingdom.

At the heart of SONICFLOOd is a longing that transcends just making music; it is a longing to see people worship God wherever they are, geographically and spiritually. “We want to see people falling in love with Jesus Christ through this amazing vehicle and gift we call music. May we see greater revelation of just how much God loves His creation and then celebrate God’s love with our worship!” exclaims Heil.

In addition to this being the first release from their own label, the new album marks the first time that SONICFLOOd is letting fans become part of the project as Executive Producers. ‘We love our fans”, states Heil “and we want them to be involved in this project, including giving them the opportunity to the pick the album cover and album title!"


Glimpse

Here In My Life

Intro:

Bb-Ebadd9-Gm7-Ebadd9

Verse 1:
Bb           Ebadd9  
I have never walked on water 
   Gm7            Ebadd9  
Felt the waves beneath my feet but  
Bb                Ebadd9  
At your word Lord I'll receive Your  
Gm7              Ebadd9  
Faith to walk on oceans deep  
 
 








Pre Chorus:  
F         Ebadd9            Bb    Bb/A  
And I remember how you found me  
 
In the very same place  
F      Ebadd9                        Gm7  
All my failing surely would have drowned me  
    Ebadd9  
But you made a way





 
 
 
 








Chorus:

Bb Bb/A
You are my freedom  
Cm7  
Jesus you’re the reason  
    Ebadd9  
I’m kneeling again at your throne  
Bb            Bb/A  
Where would I be without you  
Cm7               
Here in my Life   
Ebadd9  
Here in my Life 





 
 
INSTRUMENTAL x2  
Eb7+  Bb/A  Dm7/11     Eb