[Linux-Biella] script backup ftp

vallini.daniele a bilug.it vallini.daniele a bilug.it
Mer 2 Mar 2016 14:49:59 CET


Mon, Feb 29, 2016 at 06:02:53PM +0100  .: Federico Villa (Villinux) ha scritto: 

> Qualcuno di voi ha mai provato FTPSync?
> https://sourceforge.net/projects/ftpsync/

Lo conosco, ne ho copia ma non l'ho ancora provato.

Il codice in perl, per quanto ne capisco, mi pare molto pulito, inoltre
e' il programma consigliato per il mirroring dei repository Debian.

Direi che lo puoi provare tranquillamente, mi pare pero' adatto al
mirroring totale piu' che alla sola registrazione incrementale delle
variazioni.

Puoi scegliere le directory da sincronizzare periodicamente ed
eventualmente decidere se cancellare o meno sul client quanto cancellato
sul server.

Puo' operare bidirezionale e questa mi pare una bella prerogativa.

Ti fornisco le info essenziali del programma:

Overview:
---------

ftpsync.pl synchronizes a local directory tree and a remote FTP directory tree.

It was initally written to automize web publishing, but might be useful for
some other purposes, like mirroring not-too-large public sites, data
replication, and more.

Call "ftpsync.pl -h" to get a short parameter explanation.


Why use ftpsync.pl instead of mirror, sitecopy, ...?
----------------------------------------------------

Yes, there are similar projects, so some comments on them:

Compared to mirror, ftpsync.pl is capable of PUTing, not only GETing stuff
(Don't blame me if mirror is able to PUT, I could'nt find a way).

Compared to sitecopy, ftpsync.pl has no problems, if the remote site has been
changed since its last run by other tools and activites. Unless network
problems or bugs occur, ftpsync.pl does a reliable synchronization.

Compared to both, ftpsync.pl is very lightweight ;-))


Requirements / Restrictions:
----------------------------

- Perl 5.6+
  ftpsync.pl was initially developed on  Perl 5.6.0-81 on SuSE Linux 7.2,
  older Perl 5.x version might work. Test reports welcome at ftpsync a ibcl.at!

- File::Find, IO::Handle
  IMHO parts of the basic perl package.

- Net::FTP
  Part of the libnet-perl package.

- File::Listing
  Part of the libwww-perl package.

- UNIX like operating systems on local system
  Porting to DOS based systems should be easily done by changing the
  directory separator.

- Perhaps, the script does not work with all FTP servers
  It is beeing tested only against UNIX based FTP servers.


e l'help in linea:

FTPSync.pl 1.2.33 (2006-10-27)

 ftpsync [ options ] [ localdir remoteURL ]
 ftpsync [ options ] [ remoteURL localdir ]
 options = [-dfgpqv] [ cfg|ftpuser|ftppasswd|ftpserver|ftpdir=value ... ] 
   localdir    local directory, defaults to ".".
   ftpURL      full FTP URL, scheme
               ftp://[ftpuser[:ftppasswd]@]ftpserver/ftpdir
               ftpdir is relative, so double / for absolute paths as well as /
   -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
   -g | -G     forces sync direction to GET (remote to local)
   -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
   -p | -P     forces sync direction to PUT (local to remote)
   -q | -Q     turnes quiet operation on
   -v | -V     turnes verbose output on
   cfg=        read parameters and options from file defined by value.
   ftpserver=  defines the FTP server, defaults to "localhost".
   ftpdir=     defines the FTP directory, defaults to "." (/wo '"') 
   ftpuser=    defines the FTP user, defaults to "ftp".
   ftppasswd=  defines the FTP password, defaults to "anonymous".

 Later mentioned options and parameters overwrite those mentioned earlier.
 Command line options and parameters overwrite those in the config file.
 Don't use '"', although mentioned default values might motiviate you to.


Se lo provi danne notizia, sto pensando di utilizzarlo se non mi soddisfa
l'rsync via ssh perche' per un uso bidirezionale di SSH mi pare
necessario un tunneling sul canale, faccenda sulla quale ho ben poca
esperienza.


Maggiori informazioni sulla lista Linux