Re: [PHP] FTP issues



is your 'local system' linux? then the totally non answer is probably
that you should be using rsync.

if it's a windows machine you can probably still use rsync there by running
it on top of cygwin.

I would also recommend tunnelling the rsync traffic through an SSH connection.

Larry Bradley wrote:
The following issues are not really PHP issues, but more properly FTP
server issues, but perhaps people on the list have some ideas on how to
solve my problems.

I've written a PHP program to "mirror" data on a local drive to a remote
FTP server. It compares file mod times, and only uploads files that are
newer. Works like a charm. Except ---

The remote FTP server is running on a Fedora LINUX system, but I think
any server would present the same issues.

To examine the remote directories, I use ftp_rawlist() to get a
directory listing which I parse. However, the file modification time
does not have a year, and does not show the seconds. I get around this
by "assuming" the year is the current one, and then compare the file
times of the local and remote files ignoring local file seconds. If they
are different, I use ftp_mdtm() to get the real remote time, and then do
my compare. This slows things down a bit, as I have to go to the FTP
server one more time.

Any thoughts on how to get around this? Is there a way to get a better
directory listing?

Second and more serious problem is that when I FTP the file to the
server, the file mod time gets set to the current (file-creation) time.
The same thing happens in a local-to-local file copy using copy(), but I
can use touch() to update the mod time.

Any thoughts on how I might get the remote FTP server to do the
equivalent of touch()?

I realize that these are not actual PHP problems, but maybe one of you
has run across similar issues.

Many thanks.

Larry Bradley
Orleans (Ottawa), Ontario, CANADA
.



Relevant Pages

  • [SLE] rsync problem
    ... I'm tryng to setup copying some files from one machine to a remote ... server to my backup server. ... rsync error: some files could not be transferred at main.c ...
    (SuSE)
  • Re: remote copy file
    ... system on our server since it contains data. ... It would be nice if it would work with rsync. ... As I understand it, you need the embedded device to initiate the ransfer, not the remote PC, and you need authentication but without needing to specify a password. ...
    (alt.os.linux.suse)
  • Re: How do I use rsyncd.conf labels
    ... for the client (remote) machine to access such a "label"? ... The server can restrict ... one can configure the rsync ... daemon to 'chroot' to each path name during file transfer. ...
    (comp.os.linux.misc)
  • Re: ftp server crashes on heavy load: possible scheduler bug
    ... Could you give me some way to reproduce the specific load you put ... It's an ftp server. ... We also provide rsync service for gentoo portage users. ...
    (Linux-Kernel)
  • Frontpage does not support saving files to FTP servers.
    ... save it back to a remote FTP server. ... page I am unable to save the file back the remote server. ... none of the .htm files I'm browsing reside on my local machine. ...
    (microsoft.public.frontpage.client)