Best way to transfer file from Local path to NFS path -


i looking best optimized way can use transfer large log files local path nfs path.

here log files keep on changing dynamically time.

what using java utility read file local path , transfer nfs path. seems consuming high time.

we cant use copy commands, log file getting appended more new logs. not work.

what looking .. there way other using java utility transfer details of log file local path nfs path.

thanks in advance !!

if network speed higher log growing speed, can cp src dst.

if log grows fast , can't push data, want take current snapshot, see 3 options:

  1. like now, read whole file memory, now, , copy destination. large log files may result in large memory footprint. requires special utility or tmpfs.
  2. make local copy of file, move copy destination. quite obvious. requires have enough free space , increases storage device pressure. if temporary file in tmpfs, same first method, doesn't requires special tools (still needs memory , large enough tmpfs).
  3. take current file size , copy amount of data, ignoring appended during copying.

e.g.:

dd if=src.file of=/remote/dst.file bs=1 count=`stat -c '%s' src.file` 

stat takes current file size, , dd instructed copy amount of bytes.

due low bs, better performance may want combine dd:

dd status=none bs=1 count=`stat -c '%s' src.file` | dd bs=1m of=/remote/dst.file 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -