This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

My Rsync Incremental Script

Synchronize files & directories to/from XigmaNAS with minimal data transfer.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
User avatar
cpcnw
Starter
Starter
Posts: 27
Joined: 11 Sep 2012 19:37
Status: Offline

My Rsync Incremental Script

Post by cpcnw »

Hi all,

I know this has been done efore but just thought I would share my (copied & modded) little script - tested tonight and working how I want - so am well psyched with the results!

Code: Select all

#======================
BUDATE=$(date +%Y%m%d)
BUINC=/mnt/backup/incremental/$BUDATE
/usr/local/bin/rsync -a -b --delete --exclude-from '/mnt/data/IT/scripts/exclude.txt' --backup-dir=$BUINC /mnt/data/ /mnt/backup/full
/usr/bin/bsdtar czf /mnt/backup/incremental/$BUDATE.tar.gz $BUINC
/bin/rm -rf /mnt/backup/incremental/$BUDATE
#======================

So, on first run an entire copy of the /mnt/data directory is made in /mnt/backup/full
The next night the diffs are created in /mnt/backup/incremental/DATE
The DATE folder is tarballed up and dropped into /mnt/backup/incremental
The DATE folder is then removed

Voila! Full backup plus daily incremental tar balls! I run this every week night at 10pm via the cron panel

exclude.txt just contains .recycle, .snap, .sujournal on seperate lines

To add - remove incremental tarballs after 14 days

#!/bin/sh
find /mnt/backup/incremental/* -atime +14 -exec rm -rf '{}' \;

taken from ;

http://blog.hani-ibrahim.de/en/automati ... e-bin.html

Post Reply

Return to “RSYNC”