summaryrefslogtreecommitdiff
path: root/publish
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2012-12-15 15:33:43 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2012-12-15 15:33:43 +0000
commit87f92dbf2105d8d068e9f5956931968b7cf33c47 (patch)
tree9f3fd6c080c7b847ca23a143a223d546a4dd0f7e /publish
parentd23ca1bcb128261e6f3cc465cb3749b3eff2214c (diff)
publish-purge: a cleanup script for publish's dir
publish-purge considers for each directory in pubish's $base directory a TTL (time to live) that is configured by ~/.publish-purge.cfg and is overriden by a local .publish.ttl file. A new option -t in publish lets publish include a local .publish.ttl file if we wish to set a specific TTL. Signed-off-by: Peter Palfrader <peter@palfrader.org> git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@564 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'publish')
-rwxr-xr-xpublish12
1 files changed, 11 insertions, 1 deletions
diff --git a/publish b/publish
index f76e645..0623e2a 100755
--- a/publish
+++ b/publish
@@ -77,6 +77,7 @@ OPTIONS:
-q Produce a QR code.
-r Add --relative option to rsync so that path names of the given
files are preserved at the remote host.
+ -t days time to live in days
-x Publish the contents of the xclipboard.
EOF
}
@@ -117,7 +118,7 @@ make_qrcode=0
add_default_cs=0
relative=""
-while getopts "rhnq8HSxs:" OPTION
+while getopts "rhnq8HSxs:t:" OPTION
do
case $OPTION in
h)
@@ -154,6 +155,9 @@ do
r)
relative="--relative"
;;
+ t)
+ ttl="$OPTARG"
+ ;;
*)
usage >&2
exit 1
@@ -250,6 +254,12 @@ if command -v xclip >/dev/null 2>&1; then
fi
+if [ -n "${ttl}" ]; then
+ echo "${ttl}" >> $tmpdir/.publish.ttl
+ set dummy "$tmpdir/.publish.ttl" "$@"
+ shift
+fi
+
while [ "$#" -gt 0 ]; do
file="$1"
shift