One approach would be to create a script that transfers files to the ftp server when they appear in a watched directory. This script could be run as a daemon or through cron depending on how quickly you need it to act. This script would need to assure that only one instance was active at a time, but the techniques described in the aforementioned node should work well for this purpose. Your existing scripts would need to be modified to move files to the watched directory rather than sending them to the remote server.
On linux, another approach would be to use the fuse (filesystem in userspace) kernel module with curlftpfs (LftpFS may be a reasonable alternative; avoid FuseFTP as it is not very robust) to mount the remote server as a local file system (I believe this can be done through fstab). This also lets a single entity manage the connection to the remote ftp server. The existing scripts would need to be modified to write files to the appropriate local path (functionally sending them to the remote server via ftp). I believe that this approach will allow the ftp connection to timeout while not in use and will only reconnect when needed; it would be best to verify that this is correct.
In reply to Re: Synchronisation between multiple scripts
by eye
in thread Synchronisation between multiple scripts
by weismat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |