Table of Contents

LazyFTP

LazyFTP is a commandline PHP script that keeps remote files in sync with local files via FTP. It monitors a local directory tree for changes and uploads or deletes files as necessary to keep the remote directory in sync.

Note: LazyFTP is no longer being maintained. I do not plan to release any updates and I probably won’t answer support questions. Use at your own risk.

Requirements

  • PHP 4.3.3 or higher
  • PHP FTP extension

Downloads

Caveats

  • Only monitors local files for changes, not remote files.
  • Does not automatically create or delete remote directories. You should make sure your remote directory tree is an exact mirror of your local tree before you run LazyFTP.
  • Iterates through the local directory tree at a set interval (every five seconds by default). If you’re using LazyFTP to sync a directory with a large number of files or subdirectories, you may want to set the LazyFTP PHP process to a lower priority than other processes so it doesn’t hog the CPU.

Usage

Synopsis

lazyftp [option <argument> ...]

Options

Option Argument Description
-i <interval> Interval at which files are checked for changes (in seconds).
-l <localdir> Local directory to monitor for changes.
-p <pass> FTP password.
-P Use passive mode for file transfers.
-r <remotedir> FTP directory to which changed files should be uploaded.
-s <host> FTP server hostname or IP address.
-S Connect using SSL-FTP.
-u <user> FTP username (if not specified, login will be anonymous).
-v Enable verbose status messages.

Example

# lazyftp.php -l /my/files -s ftp.pants.com -r /home/monkey -v

Copyright

Copyright © 2003 by Ryan Grove. All rights reserved.
LazyFTP is open source software distributed under the terms of the GPL.