mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 01:41:59 +01:00
5b3161e685
Signed-off-by: Janos SUTO <sj@acts.hu>
31 lines
424 B
Bash
Executable File
31 lines
424 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -o nounset
|
|
set -o errexit
|
|
set -o pipefail
|
|
|
|
SCRIPT_PATH="$(readlink -f "$0")"
|
|
SCRIPT_NAME="${SCRIPT_PATH##*/}"
|
|
|
|
SERVERID="00"
|
|
|
|
usage() {
|
|
echo "usage: ${SCRIPT_NAME} <topdir>"
|
|
exit 1
|
|
}
|
|
|
|
|
|
[[ $# -gt 0 ]] || usage
|
|
|
|
TOPDIR="$1"
|
|
|
|
cd "/var/piler/store/${SERVERID}"
|
|
|
|
for i in "$TOPDIR"/*; do
|
|
pushd "$i" > /dev/null
|
|
d="$(basename "$i")"
|
|
zip -r -0 -q -m "${TOPDIR}_${d}.zip" .
|
|
popd > /dev/null
|
|
done
|
|
|