Shashikant shah

Monday, 16 February 2015

Script for Continue Copy Latest File.

#!/bin/bash
SOURCE=/home/shashi/data
R=/home/shashi/latest/first_log
D=/home/shashi/latest/second_log
DIST=/home/shashi/backup_latest
file=$(touch ${D})

while [ 0 = = 0 ]
do

$(find ${SOURCE} -mmin -1 | sed 1d > ${R})

DIF=$(diff ${R} ${D} | awk '{print $2}' | sed '/^$/d')

I=$(echo "${DIF}" > ${D})

        for copy in `cat $D`
        do
        cp -f $copy $DIST

        done
done

No comments:

Post a Comment