Cloud backup with MCrypt and S3cmd
Put a Sock in It
A tool called Trickle [6] lets you segregate your precious bandwidth and stop S3cmd from hogging your Internet connection. To take control of your bandwidth, install the natty little third-party package with:
# apt-get install trickle
This superb utility is a userspace bandwidth-shaping tool that you can plug in to lots of applications. Apparently, the excellent Trickle cannot affect all bandwidth services but, rather, only those programs speaking to the network that use dynamic libraries (thanks to glibc), and it doesn't play nicely with packages that are linked statically.
Fret not, because you can check against the shared library dependencies of a piece of software using the ldd
command as follows. If you get any results displayed when running this command, it's good news, and Trickle should get on with the binary. The first example of this command shows a positive hit, and the second shows that you're out of luck:
# ldd /usr/bin/ssh | grep libc.so libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f69228de000) # ldd /usr/bin/apport-bug | grep libc.so #
If you're curious (and ideally not logged in as root, because you are being careful), try the following command-line quickie. This command gives you a quick look into the path /usr/bin
to check for the programs that Trickle supports:
# cd /usr/bin # for filelist in *; do ldd $filelist | grep libc.so; echo $filelist; done
I should mention at this point that v1.0.0 of S3cmd, which automagically appeared on my laptop from Ubuntu's repositories, didn't compile automatically with dynamic libraries. I did also have the libevent
library installed as suggested. The makers of the fantastic utility say that it should nevertheless work, and it is worth trying a newer version (v1.5.0 as I write) and compiling from source.
To limit half a megabit (Mb) of download capacity to your Amazon S3 activities, use the -d
switch:
# trickle -d 512 s3cmd get chrisfile.tar.gz.ncs3://aws-bucket-name
Conversely, you can choke the upload capacity with -u
:
# trickle -u 512 s3cmd put binnie_linux.doc.ncs3://aws-bucket-name
I got an error when I first attempted to run Trickle. The fix was to spawn a standalone mode. To do this, just add -s
to the command:
# trickle -s -u 512 s3cmd put cb_linux.doc.ncs3://aws-bucket-name
If all else fails, your other options for limiting bandwidth include the Throttle utility [7], as well as tc or iptables.
It's a Nice Place
Despite the somewhat heady mix of encryption methods available on Unix-like systems, the wide and varied selection provides enough choice for you to find the most efficacious tool for each job. I've attempted to demonstrate that, for some scenarios, you might want to use a built-in encryption system for ease (e.g., S3cmd supports GPG), and you might want to scrub your deleted files automatically and diligently by default. For compatibility reasons, on the other hand, you might want to use something old school like MCrypt, which works in all sorts of ways and is commonly adopted by PHP.
The mighty and ultra-reliable AWS storage service means you won't experience angst the next time you misplace a config file that you spent all morning getting to work.
I hope this article will encourage you to forge a creative solution to suit your own file backup needs.
Infos
- MCrypt: http://mcrypt.sourceforge.net/
- Bcrypt: http://bcrypt.sourceforge.net/
- S3cmd: http://s3tools.org/s3cmd
- GPG: https://www.gnupg.org/
- CloudFront: http://aws.amazon.com/cloudfront/
- Trickle: http://monkey.org/~marius/pages/?page=trickle
- Throttle utility: http://linux.die.net/man/1/throttle
« Previous 1 2 3 4 5
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
News
-
Titan Linux is a New KDE Linux Based on Debian Stable
Titan Linux is a new Debian-based Linux distribution that features the KDE Plasma desktop with a focus on usability and performance.
-
Danielle Foré Has an Update for elementary OS 7
Now that Ubuntu 22.04 has been released, the team behind elementary OS is preparing for the upcoming 7.0 release.
-
Linux New Media Launches Open Source JobHub
New job website focuses on connecting technical and non-technical professionals with organizations in open source.
-
Ubuntu Cinnamon 22.04 Now Available
Ubuntu Cinnamon 22.04 has been released with all the additions from upstream as well as other features and improvements.
-
Pop!_OS 22.04 Has Officially Been Released
From the makers of some of the finest Linux-powered desktop and laptop computers on the market comes the latest version of their Ubuntu-based distribution, Pop!_OS 22.04.
-
Star Labs Unveils a New Small Format Linux PC
The Byte Mk I is an AMD-powered mini Linux PC with Coreboot support and plenty of power.
-
MX Linux Verison 21.1 “Wildflower” Now Available
The latest release of the systemd-less MX Linux is now ready for public consumption.
-
Microsoft Expands Their Windows Subsystem for Linux Offerings With AlmaLinux
Anyone who works with Windows Subsystem for Linux (WSL) will now find a new addition to the available distributions, one that’s become the front-runner replacement for CentOS.
-
Debian 11.3 Released wIth Numerous Bug and Security Fixes
The latest point release for Debian Bullseye is now available with some very important updates.
-
The First Alpha of Asahi Linux is Available
Asahi Linux is the first distribution to fully support Apple Silicon and is now available for testing.