Menu

Extract only newer files : will ever be ?

Gish
2010-12-17
2024-08-05
  • Gish

    Gish - 2010-12-17

    Among many useful features, 7-Zip allows to synchronizes files when adding them to an archive.
    However, this is only half-useful because it not possible to do such operation when extracting files.

    "Extract only newer files" was a feature requested since 2005, but still in an "Open" state.
    Many messages have been posted here on this topics but at the moment the feature is not even planned.
    When extracting files, the check for overwrite was alredy implemented time ago, I suppose that a check for file date should not require lot of change in the code.
    Extracting only newer files allows, for instance, to effectively "synchronize" large remote folders by transfering (or transporting) a much smaller 7-zip archive.

    However, I really wonder if this feature will ever be planned for future release.

     
  • dsaggagsdf

    dsaggagsdf - 2012-02-27

    is there an update on this status?

     
  • dsaggagsdf

    dsaggagsdf - 2012-02-27

    or are we doomed to press the file into the "7z" where its possible to over write if newer, and then extract the files?

     
  • Dwarden

    Dwarden - 2012-03-15

    there existed in past (version 4.57) such binary … in fact i have it

    unfortunately i don't know who is author, nor there is source code
    hence why i can't publish it cause it don't come from public source

    has fully working
    "-n: extract only new or changed files (skip old files)"

    i tried to search out who made it but w/o any success …

    ofcourse it don't support new 7z formats :(

     
  • Dwarden

    Dwarden - 2012-03-15

    this binary is from January 2008, if that helps anything … (and yes it's really sad this feature isn't part of 7z base so long)

     
  • Libor Striz

    Libor Striz - 2015-11-04

    It seems no change yet.
    When I remember the old good CLI JAR or ARJ archievers from 1990s with zillions of options.......
    7-zip is the great file compressor, but as an archiever - it sucks.

     
  • isidroco

    isidroco - 2020-08-09

    Can't believe 7zip can't handle obvious "newer" extraction which pkunzip already did in the 80s.
    Got here looking for that function. It's stupidly crippled, and makes it useless.

     
  • Arheos

    Arheos - 2021-01-22

    I keep visiting this (and many other similar threads) over time, but nothing happens. There isn't even a reply anymore, after one in 2006 that "it's being worked on". It's quite disappointing because this is a top priority feature for an archiver that is to be used for backup/restore and without it, 7z is limiting itself to a compression utility.
    Another hope for 2021..

     
  • John Secret

    John Secret - 2021-01-26

    I too would like to know the status of this feature. 15 years being worked on?...

     

    Last edit: John Secret 2021-01-26
  • NLS

    NLS - 2021-01-26

    Unbelievably enough I went in, exactly to ask this.
    I hope it is implemented eventually.

     
    • John Secret

      John Secret - 2021-01-29

      Well it has been far too long without any comment on this, so I think it is not going to happen.

       
  • NLS

    NLS - 2021-01-26
     

    Last edit: NLS 2021-01-26
  • Pavel Trka

    Pavel Trka - 2021-11-04

    disappointed to see this basic feature missing

     
  • mdadm

    mdadm - 2021-11-06

    You may try smartversion (or rsync) to effectively "synchronize" large remote folders. Smartversion have executables for multiple OSs.

     
    • isidroco

      isidroco - 2021-11-10

      I use total commander for that. I need 7zip for Batch use, and now it's crippled without the feature of overwriting older files.

       
  • Saulius Krasuckas

    Just in case someone waits for the option implementation.

    I just found out that bsdtar supports 7zip format and also has the option -k:

    $ bsdtar -h
    bsdtar: manipulate archive files
    First option must be a mode specifier:
      -c Create  -r Add/Replace  -t List  -u Update  -x Extract
    Common Options:
      -b #  Use # 512-byte records per I/O block
      -f <filename>  Location of archive (default /dev/tape)
      -v    Verbose
      -w    Interactive
    Create: bsdtar -c [options] [<file> | <dir> | @<archive> | -C <dir> ]
      <file>, <dir>  add these items to archive
      -z, -j, -J, --lzma  Compress archive with gzip/bzip2/xz/lzma
      --format {ustar|pax|cpio|shar}  Select archive format
      --exclude <pattern>  Skip files that match pattern
      -C <dir>  Change to <dir> before processing remaining files
      @<archive>  Add entries from <archive> to output
    List: bsdtar -t [options] [<patterns>]
      <patterns>  If specified, list only entries that match
    Extract: bsdtar -x [options] [<patterns>]
      <patterns>  If specified, extract only entries that match
      -k    Keep (don't overwrite) existing files
      -m    Don't restore modification times
      -O    Write entries to stdout, don't restore to disk
      -p    Restore permissions (including ACLs, owner, file flags)
    bsdtar 3.5.2 - libarchive 3.5.2 zlib/1.2.11 liblzma/5.2.5 bz2lib/1.0.8 liblz4/1.9.3 libzstd/1.5.0
    

    I just tried it, and it seems to work fine (although it prints the filename in question in both cases: when it's new and also when it already exists).

    I use it in MSYS2 environment (which is Cygwin-like), which may not do for other person.

     
    • isidroco

      isidroco - 2022-02-01

      But -k doesn´t update with newer files.
      But just found this wich could work will test it later
      https://documentation.help/7-Zip/update1.htm

       
      • Arheos

        Arheos - 2022-02-02

        This is used for updating an archive, it's not a new option/switch. But if you manage to magick-it to do the same for extraction..do tell..
        I think I have tried it before commenting/reading here, but can't be sure.

         
  • isidroco

    isidroco - 2024-08-05

    Bump, author should take notice of this essential missing feature, and easy to implement, just add "n" to: -ao{a|s|t|u|n} the "n" should be overwrite mode "only if newer", and the rest as usual

     

    Last edit: isidroco 2024-08-05

Log in to post a comment.