Files
apps/scripts/clean_data.sh
2018-09-02 10:26:34 +02:00

24 lines
391 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
if [ "$#" -eq "0" ]
then
if [ -d $DATA_PATH ]
then
find $DATA_PATH -mtime +1 -type f -name *.png -exec rm -f {} \;
find $DATA_PATH -mtime +1 -type f -name *.zip -exec rm -f {} \;
fi
else
if [ "$1" -eq "FULL" ]
then
if [ -d $DATA_PATH ]
then
rm -f $DATA_PATH/*/*
fi
if [ -d $TMP_PATH ]
then
rm -f $TMP_PATH/*
fi
fi
fi