Find the answer to your Linux question:
Results 1 to 3 of 3
I have a script that I'm trying to use to backup my hard drive every night. The full backups are working flawlessly. I haven't figured out the incrementals yet. I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    2

    tar incremental help


    I have a script that I'm trying to use to backup my hard drive every night. The full backups are working flawlessly. I haven't figured out the incrementals yet. I thought they were working when I first wrote the script a few weeks ago, but it doesn't seem to be working anymore.

    I have a long script that I have a whole bunch of statements like this...

    sudo tar -z --create \
    --file=/media/Backup/$(date +%y%m%d)_$(date +%H%M%S)_Pictures_Backup.tgz \
    --listed-incremental=/var/log/usr.snar \
    /home/david/Pictures/

    To be honest, I'm not a Linux expert and I was really surprised when I started this venture that Linux filing system doesn't have an archive bit like NTFS does and we have to use a file to store the archiving information. But there's the file at /var/log/usr.snar. My theory is I just leave that file for a week so I can create one full and incrementals through the week. Then when I want to create another full backup (when I swap hard drives), I then delete that usr.snar file. I thought that worked a few weeks ago, but it doesn't anymore. When I start my backups, they backup every folder I have listed and not just the files that changed. My full backups are 165 GB, so I'd like to use the incremental feature.

  2. #2
    Linux User Manko10's Avatar
    Join Date
    Sep 2010
    Posts
    250
    I was really surprised when I started this venture that Linux filing system doesn't have an archive bit like NTFS does and we have to use a file to store the archiving information.
    Also NTFS does not archive your files, it's just a background services such as the system recovery or shadow copy service.
    But Linux has several file systems, not just Ext3 and Ext4. For instance, there is ZFS or Btrfs which can create snapshots, which's kind of incremental backup.
    Another way to create incremental backups would be to use a tool like rsync. I wouldn't use tar for that. For some more information on backup strategies have a look at: Refining Linux: Thoughts on data security
    There are many tools out there and you should use one of them instead of building your own if you don't exactly know what your're doing. The linked article explains some basics of data security and how most backup tools work.
    Refining Linux Advent calendar: 24 Outstanding ZSH Gems

  3. #3
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    492
    I agree. rsync is the tool for this job, written to do exactly what you want.

  4. $spacer_open
    $spacer_close

Posting Permissions

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