/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to scripts/cron/adei_clean.cron.sh

  • Committer: Suren A. Chilingaryan
  • Date: 2019-10-11 05:50:26 UTC
  • Revision ID: csa@suren.me-20191011055026-0gnkllbxn11s47cu
Check that tmp/clients directory exists before cleaning

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
# Increasing it even 1 day will lead to a considerable slow down as more rummaging trough pack of files will be needed,
31
31
# ADEI currently doesn't reuse files. So, short is good.
32
32
# * Second variant for debugging purposes
33
 
find $path -type f -mmin +15 -delete;
34
 
#find $path -type f -mmin +15 -print0 | xargs -0 -n 100 -I '{}' sh -c 'echo "{}" | wc -w; rm -f {}';
 
33
[ -d "$path" ] && find "$path" -type f -mmin +15 -delete;
 
34
#[ -d "$path" ] && find $path -type f -mmin +15 -print0 | xargs -0 -n 100 -I '{}' sh -c 'echo "{}" | wc -w; rm -f {}';
35
35
 
36
36
# Problem with this, the previous command actually modifies directories.
37
37
# On the other hand, there would be files if somebody currently writting. So 'empty' check is enough
38
 
find $path -type d -empty -delete
39
 
#find $path -type d -mmin +15 -empty -delete
 
38
[ -d "$path" ] && find "$path" -type d -empty -delete
 
39
#[ -d "$path" ] && find $path -type d -mmin +15 -empty -delete