Subject: | |
From: | |
Reply To: | |
Date: | Thu, 15 Oct 2009 18:14:57 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On Thu, Oct 15, 2009 at 13:39, Ken Teh <[log in to unmask]> wrote:
> You need to be clear about what you mean by backup. If you are keeping a
> mirror of your data, rsync is fine. But sometimes you want a version of a
> file from 3 months ago. rsync is not going to do that for you.
Rsync will absolutely do that for you; If you ask it to.
man rsync wrote:
> -b, --backup
> With this option, preexisting destination files are
> renamed as each file is transferred or deleted. You can
> control where the backup file goes and what (if any)
> suffix gets appended using the --backup-dir and --suffix
> options.
>
> Note that if you don’t specify --backup-dir, (1) the
> --omit-dir-times option will be implied, and (2) if
> --delete is also in effect (without --delete-excluded),
> rsync will add a “protect” filter-rule for the backup
> suffix to the end of all your existing excludes (e.g. -f
> "P *~"). This will prevent previously backed-up files
> from being deleted. Note that if you are supplying your
> own filter rules, you may need to manually insert your
> own exclude/protect rule somewhere higher up in the list
> so that it has a high enough priority to be effective
> (e.g., if your rules specify a trailing inclusion/exclu-
> sion of ‘*’, the auto-added rule would never be
> reached).
>
> --backup-dir=DIR
> In combination with the --backup option, this tells
> rsync to store all backups in the specified directory on
> the receiving side. This can be used for incremental
> backups. You can additionally specify a backup suffix
> using the --suffix option (otherwise the files backed up
> in the specified directory will keep their original
> filenames).
>
> --suffix=SUFFIX
> This option allows you to override the default backup
> suffix used with the --backup (-b) option. The default
> suffix is a ~ if no --backup-dir was specified, other-
> wise it is an empty string.
So. use "rsync -avx /src/ /dst/live/ --backup
--backup-dir=/dst/shadows/$(date +%Y%m%dT%H%M%S)/" and before rsync
deletes anything from /dst/live (the mirror) it copies it to
/dst/shadows/20091015T180700. Then you can browse /dst/shadows by
date to find accidentally deleted or changed files.
There is also rdiff-backup has a sidekick web interface recovery
component which I liked until I had destination directories
irrevocably become unusable after loosing connectivity to the target
during backup, and rsnapshot.pl, which I have had no similar problem
with yet, but appears to be slower, and has no web interface for
recovery Unless you count apache directory listings.
|
|
|