2
votes

I'm trying to build a PHP script to sync ftp folder in a remote ftp server to a local folder in my server, through my searches and looking here and there i couldn't find any way to get md5 checksum for the remote ftp file without downloading it, the script will be executed automatically and on an interval of 5 minutes to compare local and remote files and sync it 2 ways, is there anyway to compare local and remote files other than comparing date modified and file size?

1

1 Answers

2
votes

Use rsync via SSH instead of FTP if possible. Otherwise, you'll have to download the file to calculate the MD5 checksum if you want to detect content changes, which kind of defeats the purpose.