I'm using tmux and cueing up a very large copy:
/bin/cp -aRv /mnt/src/folder/. /mnt/dest/folder/ 2>&1 | tee /log/big_copy_log
When I run without tee
, I see output on the terminal just fine. With tee, nothing shows in the logfile or screen. What am I missing?
- I don't mind stderr and stdout both going to the same log.
- I want to do this logging so I can audit later if necessary (multiple TB sized copy)
- The -a is because I'd like timestamps preserved, -R because there are multiple levels of folders to move, -v to log everything.
- I wasn't planning to use rsync, since this is designed to be a one-way copy.
- Using /bin/cp because cp is aliased.
- Tailing . on the src because I need all subfolders copied to dest folder
2>&1
instead of2&>1
. – pfnuesel Apr 07 '17 at 15:38rsync
is one way. Andrsync
has the ability to write to a log file natively, meaning no need to usetee
. – phemmer Apr 07 '17 at 16:06cp
at resuming unfinished transfers. The latter is particularly important when dealing with huge amounts of data. Basically, it is designed to solve all the issues you are asking about. Use it! – terdon Apr 07 '17 at 16:13