"zip: Exec format error zip failed to store a backup"

  • Platform information:
    • Hardware: RP3/16SD+128SSD
    • OS: OpenHabian
    • openHAB version: 2.5.8
      When I try to backup with the command: sudo openhab-cli backup, I get the error

/usr/share/openhab2/runtime/bin/backup: 159: /usr/share/openhab2/runtime/bin/backup: zip: Exec format error zip failed to store a backup.

The system runs from the SSD hardrive.

Could you please run the command zip to check whether you will get the same error message or the usage of the command zip will be shown ?

I’m not familiar with linux commands, what is the sintax for zip?

/usr/bin/zip 1: /usr/bin/zip: Syntax error: ")" unexpected

That’s not good, this is a command for a binary file that’s provided by the Linux distribution so shouldn’t have these kind of errors. Can you think of anything you might have done which might have changed this file?

You might be able to fix it by using the command:

sudo apt install --reinstall zip

and trying again, but you may have some corrupt system files.

2 Likes

That’s what I personally appreciate in a linux environment - it also provides documentation for it’s commands.
You just need to enter the command:

man *command*

which in your case is:

man zip

and you will see the manual page like ( just the first rows are included here ) :

ZIP(1)                                                             General Commands Manual                                                            ZIP(1)

NAME
       zip - package and compress (archive) files

SYNOPSIS
       zip [-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$] [--longoption ...]  [-b path] [-n suffixes] [-t date] [-tt date] [zipfile [file ...]]  [-xi list]

       zipcloak (see separate man page)

       zipnote (see separate man page)

       zipsplit (see separate man page)

       Note:  Command line processing in zip has been changed to support long options and handle all options and arguments more consistently.  Some old com‐
       mand lines that depend on command line inconsistencies may no longer work.

DESCRIPTION
       zip is a compression and file packaging utility for Unix, VMS, MSDOS, OS/2, Windows 9x/NT/XP, Minix, Atari, Macintosh, Amiga, and Acorn RISC OS.   It
       is analogous to a combination of the Unix commands tar(1) and compress(1) and is compatible with PKZIP (Phil Katz's ZIP for MSDOS systems).
1 Like

Speaking of which, we should really add man pages for openhab and openhab-cli

2 Likes

Thanks Benjy, reinstalling zip solved the issue.