Using Git as a backup software.
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using Git as a backup software.

    Has anyone ever considered using GIT as a repository for backing up software? Git has an advantage that it does manage by file differences. That means that a file
    that has not changed between 20190709 needs to be on the backup once and once only.

    I use rsync for backups. For what it is worth, my backup disk has the following directories:
    20180709 20180813 20180927 20181005 20181203 20181224 20190115 20190209 20190228 20190331 Music
    Each directory has /home and project directories backed up.

    Programming Project
    ==================

    I thought to take a sha1sum of each backed up file and then match each to the most recent backup. This would allow me to go back in time for files that changed, and also to eliminate the duplicates.
    Please suggest some feedback or alternatives
    ======================================

    My control structure
    [sha1sum],[filedate-time],[directory name hash], filename

    and for the directories
    [directory name hash][directory name]


    The hash would be a 64bit unsigned number.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  2. #2
    Join Date
    Feb 2005
    Location
    London, UK
    Posts
    886
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Using Git as a backup software.

    I use github for my code, not that there's much of it. Private repos are free these days for up to 3 contributors so you don't have to share you're code until it's ready for public use either. I figure that I trust github enough for me to resync my code locally if I lose the local versions, the probability of both my local solutions and github permanently losing my code all at the same time is minuscule.

  3. #3
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Using Git as a backup software.

    Hi HaydnH
    I keep each of my applications and even my shell scripts under git repositories, located on my common development drive. When I run my monthly backup of $HOME, /Develpment, /LinuxStuff/* etc, I use rsync and create a full monthly unencrypted backup.
    I was considering treating a full backup as a huge git repository. The benefit being that I could use it as a subversion backup. I don't really want to run subversion.

    As an experiment, I created a report that uses sha1sum. A sample output from the report is shown below

    Code:
    47e8af76c797ff5724b03d4805b2d50ef82703c4|soxsha1.c                        |20180903-134601|     23136|/scratch/Devel/scandir.git/src
    4b3e9fd67e9146e30fa4cf5efde1322d1105fd1f|crc32.h                          |20190302-113731|     18864|/scratch/Devel/scandir.git/src
    64db9b9ceb68cac7a6fc4de8440c20d9564c3b30|soxprepdup.c                     |20190302-120814|     11452|/scratch/Devel/scandir.git/src
    6a2260c10589d595a4e0fdcca43644de41cd5255|soxdirsha1a.c                    |20190401-203251|     35085|/scratch/Devel/scandir.git/src
    70445031d8a111f30bea11c23fad8c0116b25deb|strrstr.c                        |20190302-131233|       987|/scratch/Devel/scandir.git/src
    72af53c4ed0656a9516a426880902495a226de04|soxdirnew.c                      |20190302-120814|     20992|/scratch/Devel/scandir.git/src
    76afabac95465df760cb15141b5b8fb0fd15d9e4|soxdirsha1.c                     |20180903-134601|     35085|/scratch/Devel/scandir.git/src
    7aa89e6b6dc693497c65eb4ba0202e2dfe049593|soxdirmd5.c                      |20180903-134601|     36881|/scratch/Devel/scandir.git/src
    8275d45b8a0f2b8d9444d5352e7c5e1c07309114|dictionary.c                     |20190302-131233|     32731|/scratch/Devel/scandir.git/src/dict
    83eabf1b3e21f53258dd6f7f41fa57b191c75de4|dictionary_dump.c                |20190302-131233|      1857|/scratch/Devel/scandir.git/src/dict
    85122e6db2a168b95cef199d5f243b0292e03fe3|dictionary_dumpToFile.c          |20190302-131233|      2364|/scratch/Devel/scandir.git/src/dict
    9088eb95b4f8bb00ad0e5f9fbc6170ed1d09e250|sha.h                            |20180903-134601|      1104|/scratch/Devel/scandir.git/src
    ... ... 
    The first column is a sha1sum hash, the second the object name, followed by date, size, then directory.
    When I apply it against a monthly backup, and I sort the above report as it is in that sequence.
    I can detect duplicates, even with different filenames. I could run my report against two successive months and do a pruning from the backups. Because the sha1sums will be different for an updated file, My backups would really consist of the object if changes occurred since the previous backup.

    There are many options for archive/backup management. Some of my code goes back from 2010 and I still use most. My idea was to use a monthly backup as a huge git repository. As a reminder, git allows one to restore earlier committed files. Perhaps what I want would best be served another way.
    Last edited by lsatenstein; 3rd April 2019 at 09:52 PM.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  4. #4
    Join Date
    Dec 2011
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Using Git as a backup software.

    Happy rsnapshot user. It maintains multiple copies of your backup-source but virtually eliminates duplication by using hardlinks if files did not change. Directories get duplicated, but that is trivial in disk space. Rsync does the file-transfers from source to target, so only transfers changed data.

  5. #5
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Using Git as a backup software.

    Quote Originally Posted by pindakoe
    Happy rsnapshot user. It maintains multiple copies of your backup-source but virtually eliminates duplication by using hardlinks if files did not change. Directories get duplicated, but that is trivial in disk space. Rsync does the file-transfers from source to target, so only transfers changed data.
    Hi Pindaakoe. Thank you for the link to "rsnapshot" I am starting my read "all about it" now.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

Similar Threads

  1. Trying Out Different Backup Software
    By antikythera in forum Wibble
    Replies: 16
    Last Post: 13th September 2016, 12:34 PM
  2. Backup software
    By chasetec in forum Using Fedora
    Replies: 0
    Last Post: 27th February 2009, 06:25 PM
  3. backup software
    By b2k in forum Using Fedora
    Replies: 2
    Last Post: 19th February 2009, 08:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •