backup with rsync

I have started to use utility rsync to do** incremental** backups of my personal user data directory tree, as follows:

pe1800@linux-gkd7:~> …
pe1800@linux-gkd7:/home>** rsync --archive --exclude=.* --delete --backup pe1800 /media/Lexar**

It works well:

only files which have been changed or new files are sent to the destination.
–delete sees to it that files no longer part of the source are deleted from the destination.
–backup retains at the destination previous versions of files which are being changed or deleted by attaching a** ~ suffix**

But I have noticed that the versions of files which change frequently are all retained with **suffixes ~, ~~, ~~ **and so on. That is a bit too much of a good thing, one level, ~ is enough. Does anyone know how to limit the numberl of previous versions? I have looked through the many options but do not see it or, perhaps, do not understand it.

I will appreciate your advice. Thank you.

Just guessing – NOT tested.

--exclude="*~~"  --delete-excluded

Thank you.

On 2013-04-25 04:36, pe1800 wrote:
> I will appreciate your advice. Thank you.

I can suggest other options.

For example, you can use rdiff-backup or rsnapshot. On the second one,
you get a different tree of each backup you do, but the files that have
not changed are in fact hardlinks to the previous tree files. Only one
copy exists, saving space and time. Changed files are copied whole, of
course.

It actually uses rsync to do it.

With rdiff-backup, the previous versions are stored as rdiffs instead,
smaller sizes.

With rsync, you do something like this:


> OPTIONS="--archive --acls --xattrs --hard-links --del --stats --human-readable "

>     rsync $OPTIONS --link-dest=$PREVIOUS  --exclude=/lost+found   \
>         $WHAT/   $DESTINATION$QUE


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)