I’m not a Perl programmer by any means, but I needed to work with iMapSync. One of the requirements was to create a log file of everything that is written to the terminal window while still updating the output in the terminal window.
My buddy Ryan S. figured it out for me:
perl [script] [args] 2>&1 | tee -a [file to write output to]
He even gave me an example based on what I’d sent him:
perl imapsync -host1 host1.example.com -user1 email@example.com -authuser1 user1 -password1 pwd1 -host2 host2.anotherserver.com -user2 firstname.lastname@example.org -password2 pwd2 -authmech2 PLAIN -ssl2 –fast –reconnectretry2 1 –useheader ‘Message-Id’ –useheader ‘Message-ID’ –skipsize –delete2 –uidexpunge2 –expunge2 -debug 2>&1 | tee -a IMapSyncLog.txt
Many thanks to Ryan! 🙂