1 #!/bin/bash
2 filedate=`date "+%Y%m%d%H%M%S"`
3 list=`find / -name "*.conf" -mtime -1 -o -name "*.vcl" -mtime -1 -o -name "*.cnf" -mtime -1 -o -name "*.ini" -mtime -1`
4 #echo $list
5 for i in $list
6 do
7 #echo $i;
8 filename=${i##*/}
9 echo "filename=>"$filename
10 path=${i%/*}
11 echo "path=>"$path
12 echo "++++++"
13 mkdir -p "/var/www/backup/configure_backup"$path
14 cp -rp $i "/var/www/backup/configure_backup/"$path"/"
15 done;
16 cd /var/www/backup
17 /bin/tar -zcvf "linuxconf"$filedate".tar.gz" "configure_backup"
18 rm -rf /var/www/backup/configure_backup
19 ~