欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

备份网站 自己亲自做的bash文件 有大用 有大大用 有大大大用

#!/bin/bash

#print the directory and file


for file in /home/wwwroot/*

do

if [ -d "$file" ]

then

#   echo "tar zcPvf /home/backup/site${file##*/}-`date  '+%Y-%m-%d'`.tar.gz" $file

  tar zcPvf "/home/backup/site/${file##*/}-`date  '+%Y-%m-%d'`.tar.gz" $file

fi

done


普通分类: