Rsync - Limit Upload

Today my father asked me to send him some things. There were 10 files of approximately 250MB each; too much work to send via email, 2.5GB would exceed my limit on Dropbox, and there was no Google Drive for Linux yet (only via web, meh). The simplest solution was to store them on my server.
My first attempt was to send them via scp:
scp -r files/ julio@juliobs.com:~/www
However, the transfer was at maximum speed, causing the internet to become very slow. I could limit the speed using iptables, Trickle, pv, and even directly through the router, but these alternatives are not very practical.
To my delight, reading the scp manual, I noticed that its developers had already implemented the
option to limit the bandwidth:
-l ;limit: Limits the used bandwidth, specified in Kbit/s.
So all I needed to do was use the following command to copy the files with a limited speed of 45 Kbyte/s (360 Kbit/s):
scp -l 360 -r files/ julio@juliobs.com:~/www
But even before testing this option, I remembered rsync, which has the advantage of allowing me to
interrupt the upload and resume it later and to synchronize the files if I change something later
on.
Moreover, it also has an option to limit the upload speed:
rsync -hrPvpt --bwlimit=45 -e ssh files/ julio@juliobs.com:~/www/files
Don’t forget to limit the torrents as well 😉.

I’m a Brazilian computer engineer based in Germany, passionate about tech, science, photography, and languages.
I’ve been programming for about two decades already, exploring everything from mobile apps and web development to machine learning. These days I focus on cloud SRE and data engineering.
I volunteer in the open source and Python communities, helping organize PyCon DE and PyData Berlin, mentoring, and contributing with code and translations.
On my blog, I share Linux tips, setup guides, and personal notes I’ve written for future reference. I hope others find them helpful as well. The content is available in multiple languages.
Browse my gallery for some of my photography.
Away from the keyboard, you’ll find me at concerts, playing clarinet, cycling, scuba diving, or exploring new places, cultures, and cuisines.
Always happy to connect! 🙂