paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f7bdb06b89959a22ff001a1d5cf6882aa8ba9e02
parent 8dc717f9416f708d2d93609cfc1d992f63762fea
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Sun, 25 Aug 2019 00:04:58 -0400

Add uploadwatch script

Diffstat:
Auploadwatch.sh | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/uploadwatch.sh b/uploadwatch.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +DESTDIR=/var/www/ +WATCHDIR=/home/manager/uploads/ + +mkdir -p "$WATCHDIR" +touch /home/manager/upload.log + +find "$WATCHDIR" -mindepth 1 -maxdepth 1 -exec sh -c 'if [ ! "$1" = "" ]; then chown -R www-data:www-data "$1" && echo "==========" >> /home/manager/upload.log && rsync -vr "$1" "$2" >> /home/manager/upload.log && rm -r $1; fi' - {} "$DESTDIR" \;