Hi
Need some help with a script.
I'm basically mirroring an ftp with wget which in turn gets mirrored by another ftp. I know it's a bit messy but for security reasons it has to be done like this.
Anyway the ftp is constantly being updated with new files.
My wget script is running in a continuous loop. When it has finished downloading a file it the copies it to another folder for the other FTP server to download.
#!/bin/bash
while true
do
wget -m -nH
ftp://userassword@ip.addy.com -P /var/ftp/pub/commnews/ftp -o /var/ftp/pub/commnews/scripts/report/report.txt
cp -r /var/ftp/pub/commnews/ftp/* /var/ftp/pub/commnews/ftpsync/
done
# End of script
The wget part is working fine. Its the cp part I'm having problems with.
Is there someway of specifying the cp command to use timestamps or something. Because at the moment everytime wget finishes the download it then copies everything from folder A to folder B. I only want it to copy the new files from folder A to folder B.
Any help much appreciated.
Ta