Re: Transferring files between computers using php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Peter Ford wrote:
Here's overkill: use "fuse" to make two sshfs filesystems :)

# Make some directories to mount the remote stuff onto
mkdir -p mount_point_for_B
mkdir -p mount_point_for_C

# Use 'fuse' to make SSHFS mounts from the remotes to the new directories
sshfs B:/path_to_where_the_file_is    mount_point_for_B
sshfs C:/path_to_where_the_file_goes  mount_point_for_C

# Copy the file across: repeat this step every few seconds (cron job?)
cp mount_point_for_B/the_file_to_copy   mount_point_for_C

# Unmount the SSHFS mounts when you're finished
fusermount -u mount_point_for_B
fusermount -u mount_point_for_C

That's overkill indeed and can make for some cool flaws on you filesystem too. When an unmount won't succeed the next execution via cron will fail since the mount point already exists etc.

Every few seconds an update over to 2 systems is somehow weird. I think it is very intensive and like I said if somehow one part of the syncing 'hangs', it can fill memory or bandwidth very quickly.

So, I can't still figure out what has to be done over to these computers every minute or whatever. The situation is not really clear to me.


--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other....'/

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux