Only output file download error text when logging is turned up.
[clinton/thingy_grabber.git] / thingy_compress.sh
CommitLineData
ff24d747
OM
1#!/bin/sh
2sourcefile=${1%/}
3
4if [ ! -d "$sourcefile" ]
5then
6 echo "$1 does not appear to be a directory."
7 exit 1
8fi
9
3ac180ed 10timestamp=$(echo $(cat "$sourcefile/timestamp.txt") | sed 's/:/./g')
ff24d747
OM
11
12if [ -z "$timestamp" ]
13then
14 echo "No timestamp?"
15 exit 1
16fi
17
18output="${sourcefile} - ${timestamp}.7z"
19
20if [ -f "${output}" ]
21then
22 echo "Target file ${output} already exists"
23 exit 1
24fi
25
267z a -mx=9 "${output}" "${sourcefile}"