Results 1 to 2 of 2

Thread: Backup to tar the updated files ONLY

  1. #1
    Join Date
    Sep 2008
    Location
    Yangon, Myanmar
    Beans
    42
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Question Backup to tar the updated files ONLY

    In this post mdpalow wrote that it's possible to "copy updated files to another drive using tar".

    I use tar to take daily backups of some of my files but when I run the below command it's still copying all the files to the tar again.

    Code:
    sudo tar uvpf /media/BACKUP-1/backupFLASHDRIVE.tar /media/FLASHDRIVE
    Could you please tell me what I'm doing wrong and explain how, when my backup runs, I can get it to only copy the updated files?

  2. #2
    Join Date
    Mar 2008
    Beans
    4,715
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Backup to tar the updated files ONLY

    The tar command "tar uvpf" uses the update flag. According to
    http://www.gnu.org/software/tar/manu...tar.html#SEC57
    ‘--update’ (‘-u’) is not suitable for performing backups for two reasons: it does not change directory content entries, and it lengthens the archive every time it is used.
    To do incremental backups with tar, see
    http://www.gnu.org/software/tar/manu...ups.html#SEC87
    (in particular, section 5.2)

    However, I wonder if a different tool such as rsync might be easier to use.
    For example,
    Code:
    rsync -a /media/FLASHDRIVE/ /media/BACKUP-1
    would copy all files from /media/FLASHDRIVE/ to /media/BACKUP-1.
    One subsequent runs only files that have changed will get transferred.

Tags for this Thread

Bookmarks

Posting Permissions

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