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?

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.