From 733b1e4c50e5943de559778330061ed803070e1c Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 22 Feb 2018 16:22:17 +0100 Subject: Support more parameters from environment --- adei/configs/adei_clean.cron.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 adei/configs/adei_clean.cron.sh (limited to 'adei/configs/adei_clean.cron.sh') diff --git a/adei/configs/adei_clean.cron.sh b/adei/configs/adei_clean.cron.sh new file mode 100644 index 0000000..e9b430f --- /dev/null +++ b/adei/configs/adei_clean.cron.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +[ -f /adei/env ] && . /adei/env + +script=$( cd $(dirname "$0") && pwd )/$( basename "$0" ) +if [ -f /adei/sys/adei_clean.cron.sh -a "$script" != /adei/sys/adei_clean.cron.sh ]; then + /adei/sys/adei_clean.cron.sh + exit +fi + +adei_path="/srv/www/htdocs/adei/" +path="$adei_path/tmp/clients/" + +find $path -type f -atime +0 -exec rm -f '{}' \; +find $path -type d -empty -atime +1 -mindepth 1 -delete + +#find $path -type f -mtime +7 -exec rm -f '{}' \; +#find $path -type d -empty -atime +1 -mindepth 1 -print0 | xargs -0 -r rmdir + +path="$adei_path/tmp/log" +find $path -type f -mtime +14 -exec rm -f '{}' \; -- cgit v1.2.3