This question already has an answer here:
- saving output of another command 4 answers
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