Home Explore Blog CI



man-pages

11th chunk of `zip.man`
35a759283b297cc5a3f0951c0f0fd259f53d11e394c8c11e0000000100000fd4
 this to  work,  the  input
              file  list  and  current directory must be the same as during the
              original zip operation.

              For example, if the existing archive was created using

                     zip ‐r foofull .

              from the bar directory, then the command

                     zip ‐r foofull . ‐DF ‐‐out foonew

              also from the bar directory creates the archive foonew with  just
              the  files  not  in  foofull and the files where the size or file
              time of the files do not match those in foofull.

              Note that the timezone environment variable TZ should be set  ac‐
              cording  to  the  local timezone in order for this option to work
              correctly.  A change in timezone since the original  archive  was
              created could result in no times matching and all files being in‐
              cluded.

              A  possible approach to backing up a directory might be to create
              a normal archive of the contents  of  the  directory  as  a  full
              backup, then use this option to create incremental backups.

       -e
       --encrypt
              Encrypt the contents of the zip archive using a password which is
              entered on the terminal in response to a prompt (this will not be
              echoed; if standard error is not a tty, zip will exit with an er‐
              ror).  The password prompt is repeated to save the user from typ‐
              ing errors.

       -E
       --longnames
              [OS/2]  Use  the .LONGNAME Extended Attribute (if found) as file‐
              name.

       -f
       --freshen
              Replace (freshen) an existing entry in the zip archive only if it
              has been modified more recently than the version already  in  the
              zip  archive;  unlike  the  update  option (-u) this will not add
              files that are not already in the zip archive.  For example:

                     zip ‐f foo

              This command should be run from the same directory from which the
              original zip command was run, since paths stored in zip  archives
              are always relative.

              Note  that the timezone environment variable TZ should be set ac‐
              cording to the local timezone in order for the -f, -u and -o  op‐
              tions to work correctly.

              The  reasons  behind this are somewhat subtle but have to do with
              the differences between the Unix‐format  file  times  (always  in
              GMT)  and most of the other operating systems (always local time)
              and the necessity to compare the two.   A  typical  TZ  value  is
              ‘‘MET‐1MEST’’ (Middle European time with automatic adjustment for
              ‘‘summertime’’ or Daylight Savings Time).

              The  format  is TTThhDDD, where TTT is the time zone such as MET,
              hh is the difference between GMT and local time such as ‐1 above,
              and DDD is the time zone when daylight savings time is in effect.
              Leave off the DDD if there is no daylight savings time.  For  the
              US Eastern time zone EST5EDT.

       -F
       --fix
       -FF
       --fixfix
              Fix  the  zip archive. The -F option can be used if some portions
              of the archive are missing, but requires a reasonably intact cen‐
              tral directory.  The input archive is scanned as usual,  but  zip
              will  ignore  some  problems.   The  resulting  archive should be
              valid, but any inconsistent entries will be left out.

              When doubled as in -FF, the archive is scanned from the beginning
              and zip scans for special signatures to identify the  limits  be‐
              tween  the archive members. The single -F is more reliable if the
              archive is not too much damaged, so try

Title: zip Options: -DF (Difference Archive), -e (Encrypt), -E (Longnames), -f (Freshen), -F/FF (Fix)
Summary
This section details several zip command options. '-DF' creates an archive of new and changed files since the original, emphasizing consistent directory and TZ settings. '-e' encrypts the archive with a password. '-E' utilizes .LONGNAME extended attributes on OS/2. '-f' updates existing archive entries if modified more recently, requiring consistent TZ settings and original directory. '-F' and '-FF' attempt to fix damaged archives, with '-FF' scanning from the beginning and '-F' being preferable for less damaged archives.