1. 程式人生 > >linux 自動備份專案指令碼

linux 自動備份專案指令碼

#!/bin/sh
datestr=`date +%Y-%m-%d`
echo datestr:$datestr
savepath=~/applications/app/backup/$datestr
echo target path:$savepath 
if [ -d $savepath ]; then
rm -rf $savepath;
fi
mkdir $savepath
cp -rf ~/applications/app/lawoffice/webapps/lawoffice $savepath
cp -rf ~/applications/app/lawyer/webapps/lawyer $savepath
cp -rf ~/applications/app/justice/webapps/platform $savepath
echo 'backup app success!'