Download Flume User Manual

Transcript
Flume Examples
7. Flume Examples
Send local regular file myStuff/foo.txt to remote directory /home/auser:
flume myStuff/foo.txt auser@adomain.com:/home/auser
Results in regular file /home/auser/foo.txt.
Send local regular
/home/auser/blah.txt:
file
myStuff/foo.txt
to
remote
regular
file
named
flume myStuff/foo.txt auser@adomain.com:/home/auser/blah.txt
If /home/auser/blah.txt did not exist, it is created by copying the source file with
the new name. If /home/auser/blah.txt did exist as a regular file, it is overwritten.
Send the directory myStuff/movies and all its contents to remote directory
/home/auser:
flume –r myStuff/movies auser@adomain.com:/home/auser
results in directory /home/auser/movies containing all the contents of the source
directory.
Send the directory myStuff/movies and all its contents to remote directory named
/home/auser/hereTheyAre:
flume –r myStuff/movies auser@adomain.com:/home/auser/hereTheyAre
Assuming /home/auser/hereTheyAre did not exist, results in directory
/home/auser/hereTheyAre containing all the contents of the source directory (i.e.,
myStuff/movies is recursively copied but the top directory is renamed
hereTheyAre). However, if /home/auser/hereTheyAre was already a directory,
the result would be /home/auser/hereTheyAre/movies and all of its contents.
Send
regular
file
myProject/spec.txt
to
remote
regular
file
/home/auser/myProject/spec.txt only if the local source file is newer than the
remote destination file:
flume –u myProject/spec.txt
auser@adomain.com:/home/auser/myProject
Send any regular file under local directory myProject to the remote directory
/home/auser/myProject only if the local file is newer than its corresponding
remote version or if the remote version does not exist:
flume –r –u myProject auser@adomain.com:/home/auser/myProject
Retrieve remote regular file /home/auser/foo.txt to local directory /home/me:
flume auser@adomain.com:/home/auser/foo.txt /home/me
results in regular file /home/me/foo.txt.
Retrieve remote directory /home/auser/myData and all its contents to local
directory /home/me:
flume –r auser@adomain.com:/home/auser/myData /home/me
results in local directory /home/me/myData.
Flume 2.3 User Manual
Proprietary
Page 41 of 54