#!/bin/bash
fileName=$1
now=`date +%Y%m%d%H%M`
read -p "Are you sure delete the file or directory $1? yes|no: " input
 
if [ $input == "yes" ] || [ $input == "y" ]
then
    mkdir -p /data/$now
    rsync -aR $1/ /data/$now/$1/
    /bin/rm -rf $1
elif [ $input == "no" ] || [ $input == "n" ]
then
    exit 0
else
    echo "Only input yes or no"
    exit
fi

 

相关文章:

  • 2021-09-19
  • 2021-12-15
  • 2021-08-31
  • 2021-09-19
  • 2022-12-23
  • 2021-09-19
  • 2022-01-09
猜你喜欢
  • 2021-08-05
  • 2021-07-30
  • 2021-04-02
  • 2021-04-03
  • 2021-09-19
  • 2021-09-19
  • 2021-09-19
相关资源
相似解决方案