Script to split, compress and crypt big files

Publicado: mayo 18, 2010 en fast-tip, script, sysadmin
Etiquetas:, , , , , , , , ,

I am playing with git and github. I think that I will upload to this repository (http://github.com/keymon/snippets) all my small scripts and stuff.

Here goes one script to split, compress and asymetrically crypt big files. It is really usefull to upload or send big files to support.

It uses dd to split the files, gzip to compress them and gpg to optionally crypt. It will also uncompress or check the stripes.

Here you are the script:

The usage help:

This command splits and compress (or uncompress) using gzip big files.
It can crypt files symmetrically with gpg.
It can be interrupted, and it will check the last split or all of them.

Usage:
 file-splitter.sh [-c|-u] [-e <password>] [-s <split size in MB>] <filename> [filename ...]

 filename:
 - List of files to split and compress (and optionally crypt)
 - List of split files to check/uncompress
 - List of destination files whose splits will be checked/uncompressed

 -c: Compress (default action).
 -u: Uncompres the files,
 -v: Verify compressed files, but dot not perform any action.
 -e: Encrypt/Decrpt with gpg using given password
 -s: Set different split size (default 100MB)
 -t: Test the file integrity? This option is valid for compress,
 checking files already compressed, or to uncompress,
 checking files before uncompress.
 -f: Overwrite file if exists
Example:
 file-splitter.sh -e "Gs4.2GPsa" -s 100 -t MUREX_20100131_01.dmp

Known bugs:
 Do not use spaces os special characters in files.

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s