Hi,
I tried to create a 7z file with a script. But only an empty file was created. When I use the same command on the cli it works. I am at a loss. What do I have to do to use 7z in a script?
I'm using:
Debian GNU/Linux buster/sid
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
The command within the script...
.... and the corresponding output:
And here running the 7z command directily in the cli. Now it works:
What I'm doing wrong? Maybe someone can help me.
Thank you.
Markus
I tried to create a 7z file with a script. But only an empty file was created. When I use the same command on the cli it works. I am at a loss. What do I have to do to use 7z in a script?
I'm using:
Debian GNU/Linux buster/sid
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
The command within the script...
Code:
#!/bin/bash
7z a -r -tzip ./test.zip /home/pi/test/*
Code:
pi@raspberrypi ~ $ bash ./test7z.sh
7-Zip [32] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,32 bits,4 CPUs LE)
Scanning the drive:
0 files, 0 bytes
Creating archive: ./test.zip
Items to compress: 0
Files read from disk: 0
Archive size: 22 bytes (1 KiB)
Everything is Ok
Code:
pi@raspberrypi ~ $ 7z a -r -tzip ./test.zip /home/pi/test/*
7-Zip [32] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,32 bits,4 CPUs LE)
Open archive: ./test.zip
--
Path = ./test.zip
Type = zip
Physical Size = 22
Scanning the drive:
3 folders, 7 files, 6167 bytes (7 KiB)
Updating archive: ./test.zip
Items to compress: 10
Files read from disk: 7
Archive size: 4028 bytes (4 KiB)
Everything is Ok
Thank you.
Markus