Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2016 12:12:32 +0100
From:      Outback Dingo <outbackdingo@gmail.com>
To:        Matthew Seaman <matthew@freebsd.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: rolling backup
Message-ID:  <CAKYr3zyx-EmJr5_rSJkqPcYPf2qrPGWQAtkQFYQRZchicpRU-A@mail.gmail.com>
In-Reply-To: <56A6017E.4020801@freebsd.org>
References:  <56A5F7FF.1050606@gmail.com> <56A6017E.4020801@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 25, 2016 at 12:05 PM, Matthew Seaman <matthew@freebsd.org>
wrote:

> On 01/25/16 10:25, Sergei G wrote:
> > Is there any good application for maintaining a rolling backup of
> > filesystem?
>
> There are several alternatives here, but the standout application
> for system backups is bacula.
>
> However I suspect that this will be way overkill for your purposes --
> it's designed to backup whole networks of machines and needs its own
> RDBMS in order to track backup state.
>
> The trouble with backup software is that there is such a wide range of
> requirements over all the different possible users that once you've
> written a piece of software that is sufficiently flexible to support
> just about any common usage (and do and the management of archiving,
> backup cycling, indexing, restores etc. etc.) you will end up with a
> behemoth.
>
> If you want a small and neat script that does exactly what you want,
> then your best approach is to write it yourself.
>
> > I wrote this simple Makefile that's called from a periodic scripts to
> > maintain backups.  However, over time it will run out of space. The
> > solution would be to have the same backup reusing file names using a
> > rolling backup scheme.  Is there a project that can do that already?
>
> Hmmm.... is there any particular reason to use make(1) here?  You don't
> appear to be utilizing any of the special features of make such as
> creating an output file dependant on the ages of any input files.  It's
> not that it's wrong to use make(1) like that, but it would be more usual
> to write that as a shell script.  Probably slightly faster too, but I
> expect the overhead from make(1) is lost in the noise compared to how
> long it takes to run dump.
>
> > In rolling backup I would be using parts of the date output (date -j
> > +"%Y-%m-%d %H:%M:%S") and a mod operation to roll the number.  I just
> > don't have time to spend on it...
>
> Actually, I think your best bet is a small extension to your backup
> script that just deletes all but the last N copies of the backup for a
> particular filesystem.  Something like:
>
>   ls -1t $(backupdir)/root_* | sed -e "1,$(N)d" | xargs rm
>
> Deleting 'all but the last N' is a good strategy with backups.  Suppose
> for whatever reason, backup fails for N nights in a row.  If you just
> deleted backup files that were over N days old, you'ld be left without
> any backups at all after a certain time.  However, keeping a certain
> number of files means that you still have some backups available, albeit
> older than would be ideal.
>
>         Cheers,
>
>         Matthew
>
>
Even rclone or restic are great for backups also.....


https://restic.github.io/

http://rclone.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKYr3zyx-EmJr5_rSJkqPcYPf2qrPGWQAtkQFYQRZchicpRU-A>