summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpublish17
1 files changed, 15 insertions, 2 deletions
diff --git a/publish b/publish
index 43d5b43..4507f8d 100755
--- a/publish
+++ b/publish
@@ -50,6 +50,13 @@ base_rsync=marvin.example.com:/var/www/www.example.com/htdocs/pub
history_file=~/.publish.history
history_lines=1000
+date_format='%Y-%m-%d-'
+
+rsync_pre_invoke() { true ;}
+rsync_post_invoke() { true ;}
+publish_pre_invoke() { true ;}
+publish_post_invoke() { true ;}
+
[ -e ~/.publish.cfg ] && . ~/.publish.cfg
usage()
@@ -147,9 +154,9 @@ elif [ "$inputxclip" = 1 ] ; then
echo "Ignoring -x because there are files on the command line" >&2
fi
-d_date=$(date +'%Y-%m-%d')
+d_date=$(date +"$date_format")
d_random=$(get_random)
-d_server="$d_date-$d_random"
+d_server="$d_date$d_random"
rsync_args="--partial --recursive --compress"
d_server_http_base=$( echo -n "$d_server" | uri_encode )
@@ -165,6 +172,8 @@ else
fi
+publish_pre_invoke
+
while [ "$#" -gt 0 ]; do
file="$1"
shift
@@ -185,5 +194,9 @@ while [ "$#" -gt 0 ]; do
echo "$uri"
history_append "$uri"
+ rsync_pre_invoke
$NODO rsync $rsync_args "$file$trail" $base_rsync"/$d_server/"
+ rsync_post_invoke
done
+
+publish_post_invoke