Want to copy files to a remote server with compression? 🤔

Here’s how to do it using tar and ssh!

1. Compress & Send (prioritize speed): Ideal for small files where speed is a priority and you want to control compression at the network level.

tar cf - . | ssh -C hostname "cd ~/backups/test/; tar xvf -"

2. Compress & Send (with z flag): Best for large files to optimize compression efficiency and minimize transfer time.

tar cfz - . | ssh hostname "cd ~/backups/test/; tar xvzf -"

Which method you use depends on your preference and the speed of your connection! 🚀