Split a file into equal size chunks and archive to (e)mail account.

split -b4m file.tgz file.tgz. ; for i in file.tgz.*; do SUBJ="Backup Archive"; MSG="Archive File Attached"; echo $MSG | mutt -a $i -s $SUBJ YourEmail@(E)mail.com
This is just a little snippit to split a large file into smaller chunks (4mb in this example) and then send the chunks off to (e)mail for archival using mutt. I usually encrypt the file before splitting it using openssl: openssl des3 -salt -k <password> -in file.tgz -out file.tgz.des3 To restore, simply save attachments and rejoin them using: cat file.tgz.* > output_name.tgz and if encrypted, decrypt using: openssl des3 -d -salt -k <password> -in file.tgz.des3 -out file.tgz edit: (changed "g" to "e" for political correctness)

By: tboulay
2010-03-20 16:49:19

What Others Think

Awesome! What a great command for freeloaders who just want to take advantage of corporate generosity. Make sure when Google starts stopping people from doing this kind of thing that you complain loudly on your blog. Dirty corporations.
deltaray · 635 weeks and 4 days ago
@ deltaray, not that it matters, but where I work, and use this backup method, we pay google to host our email for 3 domains. It's far from free and definitely not 'corporate generosity'.
tboulay · 635 weeks and 4 days ago
So you pay google a lot of money to host your e-mail but you resort to backup methods like this to save money? :-(
deltaray · 628 weeks and 1 day ago
@deltaray .. A tape library, netbackup, offsite secure storage that's DR compliant + google hosting, .. or using the offsite, DR compliant, cloud space that we already pay for....
tboulay · 628 weeks and 1 day ago
Nous pouvons gagner de l'argent en jouant à des jeux en ligne. Dans ce verrouillage, nous ne pouvions pas bouger et par conséquent, nous devrions récupérer notre argent de poche. Si vous avez une idée du site Web du jeu de casino en ligne, faites-le moi savoir. En ce moment, j'utilise https://topcasinosuisse.com/ qui est un site Web sous licence et sécurisé.
schambergerabdi · 70 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: