Linux上加载windows共享目录命令以下供参考。
mount //10.167.226.119/share /mnt/winshare -o username=guest,password=asdfxxxx
#!/bin/bash
#Function:backup directory 'data' to dest 'qvbackp'
#Date:2011 04 22
#Version:1.0.0.0
declare -i count=$#
#1.backup
if [ $count == 1] && [ "$1" == "--help" ] ; then
echo "help for usage"
elif [ $count == 2 ] ; then
srcdir=$1
destdir="$2"
if [ ! -d "$srcdir" ] ;then
echo "No such file or directory"
elif [ ! -d "$destdir" ] ;then
mkdir -p $destdir
fi
if [ -d "$srcdir" ] && [ -d "$destdir" ] ;then
destfile="$destdir/$(date +%Y-%m-%d-%H-%M-%S)_data.tgz"
echo $srcdir
echo $destfile
echo "${destdir}/snapshot"
cd /
tar -g "${destdir}/snapshot" -zcf $destfile data
fi
fi
#2.upload backupdata to FTP:??不需要
host="10.167.223.206"
id="guest"
pw="guest"
localfile=$destfile
remotedir="/backup"
#3.transport the copy of backuped files:??不需要
ftp -n "$host" > $2/../ftp.log 2>&1 <user $id $pw
binary
cd $remotedir
put $localfile
bye
EOF
exit 0
阅读(490) | 评论(0) | 转发(0) |