Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #148009 > unrolled thread

Somewhat OT: data backup strategies, and did anyone write their own backup tool in C

Started byDFS <nospam@dfs.com>
First post2019-11-14 17:45 -0500
Last post2019-11-15 06:23 -0500
Articles 6 — 5 participants

Back to article view | Back to comp.lang.c


Contents

  Somewhat OT: data backup strategies, and did anyone write their own backup tool in C DFS <nospam@dfs.com> - 2019-11-14 17:45 -0500
    Re: Somewhat OT: data backup strategies, and did anyone write their own backup tool in C Ian Collins <ian-news@hotmail.com> - 2019-11-15 11:58 +1300
      Re: Somewhat OT: data backup strategies, and did anyone write their own backup tool in C chad <cdalten@gmail.com> - 2019-11-14 18:01 -0800
      Re: Somewhat OT: data backup strategies, and did anyone write their own backup tool in C Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-11-15 09:50 +0000
    Re: Somewhat OT: data backup strategies, and did anyone write their own backup tool in C Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-11-15 09:47 +0000
    Re: Somewhat OT: data backup strategies, and did anyone write their own backup tool in C Paul <nospam@needed.invalid> - 2019-11-15 06:23 -0500

#148009 — Somewhat OT: data backup strategies, and did anyone write their own backup tool in C

FromDFS <nospam@dfs.com>
Date2019-11-14 17:45 -0500
SubjectSomewhat OT: data backup strategies, and did anyone write their own backup tool in C
Message-ID<ONkzF.33509$Mf1.18185@fx11.iad>
My backup drive is external, so each night or two I plug it in and run 
some custom python code to sync local to backup.

The method is a little odd, maybe.  I copy into a SQLite table all the 
directories, filenames and modified dates on the local and backup 
drives, then use outer join queries to see what's out of sync.  Then 
copy from local to backup all new or changed files.  Then delete from 
the backup what's not in local.  When done they're pretty much mirror 
images.

It works fine, but loading the filenames into SQLite is slow.  I don't 
run it for the entire drive - just the directories I altered since the 
last backup.  Which I have to remember, or go hunting thru.  So it's not 
very efficient.

Rather than using the database, I probably should just go directory by 
directory, file by file.  I'm thinking of doing it in C (for practice, 
using dirent() or command()).

How do you guys backup your systems?  rsync?

Anyone write their own C code to do it?

[toc] | [next] | [standalone]


#148010

FromIan Collins <ian-news@hotmail.com>
Date2019-11-15 11:58 +1300
Message-ID<h364fuF4cl5U15@mid.individual.net>
In reply to#148009
On 15/11/2019 11:45, DFS wrote:
> My backup drive is external, so each night or two I plug it in and run
> some custom python code to sync local to backup.
> 
> The method is a little odd, maybe.  I copy into a SQLite table all the
> directories, filenames and modified dates on the local and backup
> drives, then use outer join queries to see what's out of sync.  Then
> copy from local to backup all new or changed files.  Then delete from
> the backup what's not in local.  When done they're pretty much mirror
> images.
> 
> It works fine, but loading the filenames into SQLite is slow.  I don't
> run it for the entire drive - just the directories I altered since the
> last backup.  Which I have to remember, or go hunting thru.  So it's not
> very efficient.
> 
> Rather than using the database, I probably should just go directory by
> directory, file by file.  I'm thinking of doing it in C (for practice,
> using dirent() or command()).
> 
> How do you guys backup your systems?  rsync?

rsync is as good as anything for quick and reliable backups.  If you 
want history, use a filesystem such as ZFS that supports snapshots and 
replication.

-- 
Ian.

[toc] | [prev] | [next] | [standalone]


#148015

Fromchad <cdalten@gmail.com>
Date2019-11-14 18:01 -0800
Message-ID<10d2fa09-3a2a-4109-82f3-ef77b2916502@googlegroups.com>
In reply to#148010
I use rsync to backup the porn on my smartphone.

[toc] | [prev] | [next] | [standalone]


#148020

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2019-11-15 09:50 +0000
Message-ID<slrnqsst7j.2ntj.grahn+nntp@frailea.sa.invalid>
In reply to#148010
On Thu, 2019-11-14, Ian Collins wrote:
> On 15/11/2019 11:45, DFS wrote:
...
>> How do you guys backup your systems?  rsync?
>
> rsync is as good as anything for quick and reliable backups.  If you 
> want history, use a filesystem such as ZFS that supports snapshots and 
> replication.

Note that you can get history with just rsync and an ordinary Unix
file system, too -- see my other posting.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#148019

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2019-11-15 09:47 +0000
Message-ID<slrnqsst2b.2ntj.grahn+nntp@frailea.sa.invalid>
In reply to#148009
On Thu, 2019-11-14, DFS wrote:
> My backup drive is external, so each night or two I plug it in and run 
> some custom python code to sync local to backup.
...

> How do you guys backup your systems?  rsync?

Yes, and more specifically

       Mike Rubel: Easy Automated Snapshot-Style Backups with Linux and Rsync
       <http://www.mikerubel.org/computers/rsync_snapshots/>.

together with a small shell script I wrote

       git://snipabacken.se/rsync-backup

> Anyone write their own C code to do it?

No, I'd feel terrible trying to replicate the features of rsync,
getting them wrong, and ending up with useless backups.  I enjoy
reinventing wheels, but you have to draw the line somewhere.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#148025

FromPaul <nospam@needed.invalid>
Date2019-11-15 06:23 -0500
Message-ID<qqm1rs$6ni$1@gioia.aioe.org>
In reply to#148009
DFS wrote:
> My backup drive is external, so each night or two I plug it in and run 
> some custom python code to sync local to backup.
> 
> The method is a little odd, maybe.  I copy into a SQLite table all the 
> directories, filenames and modified dates on the local and backup 
> drives, then use outer join queries to see what's out of sync.  Then 
> copy from local to backup all new or changed files.  Then delete from 
> the backup what's not in local.  When done they're pretty much mirror 
> images.
> 
> It works fine, but loading the filenames into SQLite is slow.  I don't 
> run it for the entire drive - just the directories I altered since the 
> last backup.  Which I have to remember, or go hunting thru.  So it's not 
> very efficient.
> 
> Rather than using the database, I probably should just go directory by 
> directory, file by file.  I'm thinking of doing it in C (for practice, 
> using dirent() or command()).
> 
> How do you guys backup your systems?  rsync?
> 
> Anyone write their own C code to do it?
> 

Your message header, User Agent says:

    Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1

Are you looking for a solution for your posting machine,
or for some other machine ?

You should state, at a minimum, what your distro is, and
what your file system choice is (in case there is something
magical about the file system).

Commercial incremental backup software, avoids getting
your hands dirty.

    Paul

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c


csiph-web