summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpublish26
1 files changed, 15 insertions, 11 deletions
diff --git a/publish b/publish
index 460e0d2..0f6b790 100755
--- a/publish
+++ b/publish
@@ -51,6 +51,8 @@ base_rsync=marvin.example.com:/var/www/www.example.com/htdocs/pub
history_file=~/.publish.history
history_lines=1000
+ttl=180
+
date_format='%Y-%m-%d-'
rsync_args="--compress --times --chmod=u=rwX,go=rX"
@@ -220,12 +222,12 @@ d_server="$d_date$d_random"
d_server_http_base=$( echo -n "$d_server" | uri_encode )
base_uri="$base_http/$d_server_http_base/"
main_uri="$base_uri"
-trail=""
one_dir_only=""
if [ "$#" = 1 ]; then
if [ -d "$1" ]; then
- trail="/"
+ set dummy "$1/"
+ shift
one_dir_only=1
else
main_uri="$base_uri$( echo -n "$(basename "$1")" | uri_encode )"
@@ -276,20 +278,22 @@ while [ "$#" -gt 0 ]; do
file="$1"
shift
- if [ -z "$relative" ]; then
- if [ -z "$one_dir_only" ]; then
- uri="$base_uri""$( echo -n "`basename "$file"`" | uri_encode )"
+ if [ "${file%/.publish.ttl}" == "$file" ]; then
+ if [ -z "$relative" ]; then
+ if [ -z "$one_dir_only" ]; then
+ uri="$base_uri""$( echo -n "`basename "$file"`" | uri_encode )"
+ else
+ uri="$base_uri"
+ fi
else
- uri="$base_uri"
+ uri="$base_uri""$( echo -n $file | uri_encode )"
fi
- else
- uri="$base_uri""$( echo -n $file | uri_encode )"
+ echo "$uri"
+ history_append "$uri"
fi
- echo "$uri"
- history_append "$uri"
rsync_pre_invoke
- $NODO rsync --recursive $rsync_args $relative "$file$trail" $base_rsync"/$d_server/"
+ $NODO rsync --recursive $rsync_args $relative "$file" $base_rsync"/$d_server/"
rsync_post_invoke
done