Skip to Content.
Sympa Menu

baslinux - [BL] use your gmail acct for archiving/backup

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: baslinux AT lists.ibiblio.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: [BL] use your gmail acct for archiving/backup
  • Date: Thu, 12 Jul 2007 15:03:42 -0400 (EDT)

As some of us know already, gmail offers almost 3GB of mail storage. That's a fair amount of space so far as BL target hardware is concerned. Even users of more modern machines/OSes have looked into ways of utilizing the gmail space beyond simply using it for mail storage. I think I mentioned a Linux project called gmailfs awhile back on-list in this connection. I recently thought up an alternate scheme for using your gmail as a sort of archive/backup that uses utilities found on most Linux systems--including, I believe, BL. Anyway, I'd like to run my scheme by list members here in case it might be useful for someone or in case there might be some errors found or some improvements suggested.

First, some qualifications. The method I describe presumes one intends to archive/backup a fairly large amount of data--say more than 20MB (the maximum attachment size one may receive using a gmail account). As such, this solution may appeal only to those with broadband connections. Those on dialup can, of course, use gmail for archiving/backup in a similar fashion, but the directions I supply won't be so interesting to them: they will have simpler means of doing much the same thing, though on a smaller scale.

Anyway, the directions involve tarring up directories, then splitting them into chunks just under the maximum attachment size allowed by gmail. As I understand it, maximum gamil attachment size has now been upped to 20MB. So, without further ado, directions follow:

========START DIRECTIONS=========
directions on how to tar up a directory (e.g., music, photos, videos), then split it into chunks of requisite size such as can be mailed to your gmail account for storage/archiving.

1) cd to the subdirectory in which the target (music, photos, videos) directory resides

2) tar the directory as follows: tar -cvvf my-music-2007jun my-music/ (this creates a tar file called my-music-2007jun in the subdirectory from which you issued the tar command)

3) issue the command split -d -b 19500k my-music-2007jun my-music-2007jun (the -d option causes numeric suffixes to be appended to the resulting, split, ca. 20MB files, instead of the alphabetic suffixes split wants to assign them by default). you end up with a series of files named my-music-2007jun01 my-music-2007jun02 my-music-2007jun03 etc, all just under 20MB in size (19968000k, to be precise).

4) e-mail, individually, the created files to yourself at your gmail account

5) once you see that all backup file attachments have successfuly reached your gmail account, delete the split files you created

Reassembly: download the attachments to your system and then cat them together, as follows: cat my-music-2007jun01 my-music-2007jun02 my-music2007jun03
my-music-2007jun . untar the resulting my-music-2007jun file
==========END DIRECTIONS==============

Please let me know if you find any mistakes or think of any improvements: maybe it's possible to tar and split all in one operation? Maybe a directory should be created, like /home/user/gmail-backup, and the split files moved there all in the same operation? I'm not much of a bash scripter myself, so there could surely be improvements in that respect. Please note that I've not tried actually mailing myself these attachments, though I did experiment with splitting a directory on my system and it seems to work properly. I also did not try cat'ting the tar files back together, then untarring the whole. So, some work may, and testing definitely does, remain to be done. Just wanted to share what I've come up with so far.

Possible hitches I can think of: your smtp server may limit the amount of traffic they will relay for you per e-mail or day, so you may not be able to mail yourself in one sitting the entire directory you've tarred. If your smtp server limits your attachment sizes to less than 20MB, then these directions will obviously need to be modified (see step 3).

James




Archive powered by MHonArc 2.6.24.

Top of Page