First you have to know what type of address the remote gets; if it's a "private IP" then the remote must contact you and establish a connection. If it's a global IP, then the remote can be set up to send you a message updating the IP that you have. If your connection is intermittent then it's best if the remote does all the work. For these situations I normally write a client/server system with the remotes running the client; the client connects to the server and receives instructions (send this list of files, delete these files, update that file ...) and proceeds to send data. Without writing your own software, you can do something like this:
1. remote sends a directory list to a fixed IP
2. fixed IP machine creates a script instructing the remote what to do; puts it in a fixed directory
3. remote downloads the script via scp, deleting the original, then executes the script
If you want to send all data, you can run a cron job with 'rsync'. To avoid needless waste of time as the number of files build up, you need to relocate completed files or delete them.
I can't really give you a specific solution as such because I have no idea what your requirements are.
|