
#!/bin/bash
cd /data/inspect
list=$(find /data/inspect -maxdepth 1 -type d)
for name in $list; do
  tar cvf ${name}.tar ${name}
  exit_status=$?
  if [ $exit_status -eq 0 ]; then
    rm -fr ${name}
  fi
done

