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:
- 7z keeps adding a
.7z
extension to my temporary filename which breaks my subsequent commands - 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?
to skip the extension just append a dot at the end of the file-name: e.g.
7z files "myzip."