08-28-2008
19,
0
Join Date: Aug 2008
Last Activity: 5 November 2008, 3:28 PM EST
Posts: 19
Thanks Given: 0
Thanked 0 Times in 0 Posts
Can somebody solve this please
I have to find the files older than 200 days from a path and copy them to some other directory with the current date stamp attached to it.
i have written like follows:
#!/bin/ksh
DSTAMP=$(date +"%y%m%d%H%M")
rm $CA_OUT_PATH/ftp_logs/temp
touch $CA_OUT_PATH/ftp_logs/temp
chmod 777 $CA_OUT_PATH/ftp_logs/temp
find $CA_OUT_PATH/*/ftp_out -type f -mtime -200 > $CA_OUT_PATH/ftp_logs/temp
while read line
do
cp -f $line $CA_OUT_PATH/ftp_logs/${line}.$DSTAMP
done < $CA_OUT_PATH/ftp_logs/temp
but its trying to copy the entire path of the file and failing.
I need to copy the only filenames.datestamp after the search
pls look in to this help me out.