Link to home
Create AccountLog in
Avatar of sminfo
sminfo

asked on

How to sincronize local folder with a remote ftp folder..

Hi

I have on local linux server:

folderA
      |-----folder B
                 |---- files
      |-----folder C
                 |---- folder C1
                              |----- files
And so on.
But I have the same structure on a remote ftp linux server and I want to make a script or use any open source tool or program or something to sincronize all files and folders from the local  to the the remote server, comparing files by date, size, etc.  Question:

- Is there any tool, program, script, or something available for doing this? or I have to do the script by my self?

Thanks
Avatar of avilov
avilov
Flag of United States of America image

you can use rsync for that

http://en.wikipedia.org/wiki/Rsync
Avatar of sminfo
sminfo

ASKER

Do I have to install rsync on both sides?, take in mind I can't install rsync on the other side because it's not mine.
You don't have to install rsync on the other site. It's not a server-client based program.
Avatar of sminfo

ASKER

Hi,

can  rsync  work over ftp? I mean, sincronize local foldes to remote's one on a FTP server?
I read the man page but I couldn't find any use with FTP.

You can configure rsync to run as daemon to keep both the hosts synchronized. But if you have a firewall in between which blocks TCP port 873, rsync will not work.

However if you intend to use ftp then you have to configure incrontab (http://linux.die.net/man/5/incrontab) to raise events such as file modified and folder modified to trigger a script which will do the ftp.

Rsync can't work over ftp, but it can work over ssh.

example:
rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/ 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sminfo
sminfo

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of sminfo

ASKER

issue solved