Here's what I'm trying to do:
- I need to automate process of copying files from server A to server B. I ideally would like to have a script that is invoked by a cron job periodically on server B.
- The files I need to copy are executables and so I need to make sure that no bits are lost during copying.
I have come across command line solutions but I need a programmatic solution. How could I go about doing this?
Best Answer
rsync
,scp
. Either one will work, and either are trivial to use "programmatically".For instance, here's a shell script to copy some files from server-01 to server-02:
(this assumes that key auth is already configured between these servers)
...and an rsync example: