0

This is basically what I'm trying to do:

TEMP_ZIP_NAME="$(tempfile)"
ZIP_NAME="${NOW}-views.tar.7z"
tar c -C /srv/partybus.com views public_html/css 2>> "${CRONLOG}" \
    | 7z a -si "${TEMP_ZIP_NAME}" 2>> "${CRONLOG}" 

But there's 2 problems:

  1. 7z keeps adding a .7z extension to my temporary filename which breaks my subsequent commands
  2. Even if I use tempfile -s .7z instead, 7z gets upset because the 0-byte tempfile is not a valid archive.

How can I force 7z to just overwrite the temp file as-is?

muru
  • 197,895
  • 55
  • 485
  • 740
mpen
  • 2,186

1 Answers1

1

to skip the extension just append a dot at the end of the file-name: e.g. 7z files "myzip."

TmTron
  • 436