相关资讯
本类常用软件
-
福建农村信用社手机银行客户端下载下载量:584204
-
Windows优化大师下载量:416902
-
90美女秀(视频聊天软件)下载量:366961
-
广西农村信用社手机银行客户端下载下载量:365699
-
快播手机版下载量:325855
今天要跟朋友们分享的是linux shell 目录备份脚本,希望对朋友们有所帮助!下面一起来看看吧!
linux shell 目录备份脚本:
#!/bin/bash
#this shell is create by ben@enmuo.cn
filename=`date +%Y%m%d%H%M%S`
echo -n "please input backup directory name:"
read directory
if [ ! -d $directory ]
then
echo 2>&1 >> /dev/null
echo -e "\033[41;37;5m $directory is not in thid directory ,please check your input!\033[0m"
else
tar -cf $directory-$filename.tar $directory
fi
if [ -f $directory-$filename.tar ]
then
echo "$directory backup successed ! backup name is $directory-$filename.tar"
else
echo -e "\033[41;37;5m warning $directory backup fail,please check!\033[0m"
fi