remove_data.sh 432 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. abs_path=$(cd `dirname $0`; pwd)
  3. sample_path="${abs_path}/../data"
  4. data_date=""
  5. if(($#==1))
  6. then
  7. data_date=$1
  8. else
  9. data_date=$(date +%Y%m%d -d "-17 $days day")
  10. fi
  11. # remove
  12. test_file="${sample_path}/${data_date}_00000.csv"
  13. if [ ! -f $test_file ]
  14. then
  15. echo `date` "${test_file} is not exist"
  16. else
  17. echo `date` "rm -f ${sample_path}/${data_date}_000*.csv"
  18. rm -f ${sample_path}/${data_date}_000*.csv
  19. fi