Created
September 27, 2017 04:01
-
-
Save foru17/4c7a241c95fe6f01e4f2575f36973559 to your computer and use it in GitHub Desktop.
预处理清理上传的文件夹和文件。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author luolei | |
# Updated 2017-09-25 | |
LOGFILE=/data/logs/ars/ars_preclean.log | |
ZERO=`date +%s%N` | |
echo '====================' >> $LOGFILE | |
echo 'Start the preclean process ...' >> $LOGFILE | |
echo 'Param: ' $1 >> $LOGFILE | |
for line in `cat $1` | |
do | |
echo 'Item: ' $line >> $LOGFILE | |
if [ -d $line ]; then | |
rm -rf $line >> $LOGFILE | |
elif [ -f $line ]; then | |
echo 'File: ' $line >> $LOGFILE | |
rm $line >> $LOGFILE | |
fi | |
done | |
echo 'Done.' >> $LOGFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment