By phpimpact
via phpimpact.wordpress.com
Published: Jul 22 2008 / 15:45
FileSyncTask is a Phing extension for Unix systems which synchronizes files and directories from one location to another while minimizing data transfer. FileSyncTask can copy or display directory contents and copy files, optionally using compression and recursion.
Tweet
SaveShareSend
Tags: frameworks, php, tools, unix-linux
Comments
jfb3 replied ago:
Actually he's using rsync to synchronize files and directories. It seems like a lot of extra layers just to use rsync.
From the man page:
rsync(1) rsync(1)
NAME
rsync -- a fast, versatile, remote (and local) file-copying tool
SYNOPSIS
Local: rsync [OPTION...] SRC... [DEST]
Access via remote shell:
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST
Access via rsync daemon:
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST]
rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST
rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST
Usages with just one SRC arg and no DEST arg will list the source files instead of
copying.
DESCRIPTION
Rsync is a fast and extraordinarily versatile file copying tool. It can copy
locally, to/from another host over any remote shell, or to/from a remote rsync dae-
mon. It offers a large number of options that control every aspect of its behavior
and permit very flexible specification of the set of files to be copied. It is
famous for its delta-transfer algorithm, which reduces the amount of data sent over
the network by sending only the differences between the source files and the exist-
ing files in the destination. Rsync is widely used for backups and mirroring and as
an improved copy command for everyday use.
Rsync finds files that need to be transferred using a "quick check" algorithm (by
default) that looks for files that have changed in size or in last-modified time.
Any changes in the other preserved attributes (as requested by options) are made on
the destination file directly when the quick check indicates that the file's data
does not need to be updated.
Some of the additional features of rsync are:
o support for copying links, devices, owners, groups, and permissions
o exclude and exclude-from options similar to GNU tar
o a CVS exclude mode for ignoring the same files that CVS would ignore
o can use any transparent remote shell, including ssh or rsh
o does not require super-user privileges
o pipelining of file transfers to minimize latency costs
o support for anonymous or authenticated rsync daemons (ideal for mirroring)
phpimpact replied ago:
Of course, they are all linux command: rsycn, ftp, svn, etc The idea is to integrate them to Phing and Ant and use them in the day-to-day deployment routine.
The good thing about automating these tasks is that you don't need to remember commands and options. The biggest problem of doing it manually is that you are at risk of typing the wrong option or path and making a mess.
Voters For This Link (9)
Voters Against This Link (0)