diff options
author | Philip Wittamore <philip@wittamore.com> | 2025-05-07 21:34:07 +0200 |
---|---|---|
committer | Philip Wittamore <philip@wittamore.com> | 2025-05-07 21:34:07 +0200 |
commit | 66d9ecaa26925ffcc0947e887cc7a94f79268644 (patch) | |
tree | cde639475dfa226ad8d5353a7a5142fa23f0649b /blogsend | |
download | blog-66d9ecaa26925ffcc0947e887cc7a94f79268644.tar.gz blog-66d9ecaa26925ffcc0947e887cc7a94f79268644.tar.bz2 blog-66d9ecaa26925ffcc0947e887cc7a94f79268644.zip |
blog scripts
Diffstat (limited to 'blogsend')
-rwxr-xr-x | blogsend | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/blogsend b/blogsend new file mode 100755 index 0000000..6aaa041 --- /dev/null +++ b/blogsend @@ -0,0 +1,39 @@ +#!/bin/sh + +# 2025-03-29 15:36:12 +# blogsend : scp blog files to web server +# usage : blogsend hours (if not set default is 1 hour) +# example : blogsend 72 sends files modified over the past 3 days + +# folders +rf=mail:/var/www/html/wittamore.com +mf=~/.local/src/web/wittamore.com +cd $mf + +# test if var is sent +if [[ -z "$1" ]]; then + HOURS=1; +else + # test if va is a number + if [[ "$1" =~ ^[0-9]+$ ]]; then + HOURS=$1; + else + HOURS=1; + fi +fi + +MINUTES=$(($HOURS*60)) + +echo "Sending files modified in the past $HOURS hour(s)..." + +files=$(find * -iname "*.html" -path .tmp -prune -o -mmin -$MINUTES -type f) +for file in $files +do + echo -ne "-> "; + scp -r "$file" "$rf/$file"; +done + +echo "Done." + +exit 0 + |