Transfering files from one server to another.
My oracle database is generating archive logs. I want to copy those archive logs over to backup server on a regular basis. I know how to create an ftp job and I can put it in my crontab. My problem is that I don't know how to send the files just once instead of sends all the files in the directory over and over.
Example: I have archives 1, 2 & 3 when the cron job starts. It sends archives 1, 2 & 3 over to the other server. Now 6 hours later when the cront job runs again there are archives 1, 2, 3, 4 & 5. How do I make the program know that I have already sent over 1, 2 & 3 so that is only sends 4 & 5? I am thinking that if the ftp could return the contents of the directory on the backup server then some how compare what is in the directories of the two servers and only send over the difference that would solve my problem. I know that I can do a dir to find out what is over there but I don't know how to handle what comes back and then compareing them. Does any one have any ideas or am I on the wrong track entirelly? I appericate your help.
|