-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-script.sh.sample
More file actions
42 lines (34 loc) · 1.39 KB
/
post-script.sh.sample
File metadata and controls
42 lines (34 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
# Template post-script for `generate_stats.py --post-script=post-script.sh`.
#
# This sample is committed to the repo. Copy once to a file that is
# gitignored, make it executable, and customize it:
#
# cp post-script.sh.sample post-script.sh
# chmod +x post-script.sh
# python generate_stats.py mylog.adi --post-script=./post-script.sh
#
# generate_stats.py passes the absolute output directory as $1.
# Exit non-zero on failure so the generator surfaces the error.
set -e
SRC="$1"
if [ -z "$SRC" ]; then
echo "Usage: $0 <output-dir>" >&2
exit 64
fi
if [ ! -d "$SRC" ]; then
echo "Error: not a directory: $SRC" >&2
exit 66
fi
# ---- EDIT BELOW -------------------------------------------------------------
# Pick one (or several). Replace placeholders with your values.
# 1) Upload to a webserver via scp
# scp -r "$SRC" user@yourhost.example:/home/user/public_html/sh5/
# 2) Mirror to a webserver with rsync (incremental, faster on re-uploads)
# rsync -az --delete "$SRC/" user@yourhost.example:/home/user/public_html/sh5/"$(basename "$SRC")/"
# 3) Archive to a local directory
# cp -R "$SRC" /path/to/archive/
# 4) Notify yourself when done
# echo "Stats ready: $SRC" | mail -s "Contest stats generated" you@example.com
# -----------------------------------------------------------------------------
echo "post-script: no action configured (edit ${0} to enable an action)."