- EXAMPLE of using maxerrors feature
- SCRIPT CATEGORIES
turbo-ftp-sync - a script moves changes of files and folders of a local machine to a remote one via FTP very fast with minimum network traffic.
turbo-ftp-sync [ options ] [ <localdir> <remoteURL> ]
The script synchronizes files and folder on an FTP server with local ones via usual FTP protocol. The advantage of this script over usual FTP client is it doesn't upload all data every time but only once.
Its secret is that it doesn't ask a FTP server about last modification date and current size of each file. These information is stored in local SQLite db. Therefore this program doesn't explore folder tree of a remote host. It acts blindly. You can interrupt a process of this program in any time and you will not lose changes which you already uploaded.
The program can move changes only one direction from a local machine to remote one. If a file was changed on a remote machine and a local one then the program overwrite the remove version of the file by the local one.
turbo-ftp-sync.pl is based on sources of ftpsync.pl program. Christoph Lechleitner is the initial author of ftpsync.pl (email@example.com)
local directory, by default is current one(.)
full FTP URL
ftpdir is relative, so
ftp://[ftpuser[:ftppasswd]@]ftpserver// for absolute paths
- -c | -C
like -i, but then prompts whether to actually do work
- -d | -D
turns debug output (including verbose output) on
- -f | -F
flat operation, no subdir recursion
- -h | -H
prints out this help text
- -i | -I
forces info mode, only telling what would be done
- -n | -N
no deletion of obsolete files or directories
- -l | -L
follow local symbolic links as if they were directories
- -q | -Q
turns quiet operation on
- -b | -B
build DB only - i.e don't upload data to remote host. For example you have alread upload an archive to a remote host and extracted it. Then the remove copy of data equals to local one. And reuploading all data yet another time with this script is redundant.
# Instead. turbo-ftp-sync.pl db=db.db wroot ftp://ftp.com// # Use turbo-ftp-sync.pl -b db=db.db wroot # here you change something in wroot folder turbo-ftp-sync.pl db=db.db wroot ftp://ftp.com//
- -v | -V
turnes verbose output on
if not 0 then program exit with nonzero code.
read parameters and options from file defined by value.
defines the FTP server, defaults to "localhost".
defines the FTP user, defaults to "ftp".
defines the file where info about uploaded files is stored.
defines the FTP password, defaults to "anonymous".
defines a regexp to ignore certain files, like .svn
EXAMPLE of using maxerrors feature
It allow to self terminate process if it was encountered definite number failure attempts to upload a file or a dir. Usually such situation means your free ftp server bans you. And it bases on experiency the better decision is to termitate program with error. But it's the end. We don't surrender! We've foreseen that.
while : ; do turbo-ftp-sync.pl db=db.db wroot ftp://ftp.com// && break ; done
Daneel S. Yaitskov <firstname.lastname@example.org>
Copyright (c) 2011, Daneel S. Yaitskov <email@example.com>
All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.