auto backup

 
0 2 * * * /home/opcenterap/opRequirementBackup.sh
#!/bin/bash
 
subFolder=""
subFolder="$subFolder op001001"
subFolder="$subFolder op002002"
subFolder="$subFolder op005005"
subFolder="$subFolder op008008"
subFolder="$subFolder op009009"
subFolder="$subFolder op152152"
subFolder="$subFolder op238238"
 
for item in $subFolder
do
        sourcePath="/ftpdata/$item/upload/"
        targetPath="/ftpdata/opRequirementBackup/$item"
        echo "# cp $sourcePath requirement to $targetPath"
        rm $targetPath/*
        find $sourcePath -type f -name *[0-9].txt -mtime -1 -exec cp {} $targetPath \;
        gzip -vf $targetPath/*
        echo ""
done
 
 
 

#!/bin/bash

 

subFolder=""

subFolder="$subFolder op001001"

subFolder="$subFolder op002002"

subFolder="$subFolder op005005"

subFolder="$subFolder op008008"

subFolder="$subFolder op009009"

subFolder="$subFolder op152152"

subFolder="$subFolder op238238"

 

for item in $subFolder

do

        sourcePath="/ftpdata/$item/upload/"

        targetPath="/ftpdata/opRequirementBackup/$item"

        echo "# cp $sourcePath requirement to $targetPath"

        rm $targetPath/*

        find $sourcePath -type f -name *[0-9].txt -mtime -1 -exec cp {} $targetPath \;

        gzip -vf $targetPath/*

        echo ""

done

 

 

 

© 2015 版權所有。

Create a website for freeWebnode