Use These Python Based Tools for Se­cured Backup and Re­cov­ery of Data

Python, the ver­sa­tile pro­gram­ming en­vi­ron­ment, has a va­ri­ety of uses. This ar­ti­cle will fa­mil­iarise the reader with a few Python based tools that can be used for se­cured backup and re­cov­ery of data.

OpenSource For You - - Contents -

We keep data on por­ta­ble hard disks, me­mory cards, USB Flash drives or other such sim­i­lar me­dia. En­sur­ing the long term preser­va­tion of this data with timely backup is very im­por­tant. Many times, these me­mory drives get cor­rupted be­cause of ma­li­cious pro­grams or viruses; so they should be pro­tected by us­ing se­cure backup and re­cov­ery tools.

Pop­u­lar tools for se­cured backup and re­cov­ery

For se­cured backup and re­cov­ery of data, it is al­ways prefer­able to use per­for­mance-aware soft­ware tools and tech­nolo­gies, which can pro­tect the data against any ma­li­cious or unau­then­ti­cated ac­cess. A few free and open source soft­ware tools which can be used for se­cured backup and re­cov­ery of data in mul­ti­ple for­mats are: AMANDA, Bac­ula, Bar­cos, CloneZilla, Fog, Rsync, BURP, Du­pli­cata, Back­upPC, Mondo Res­cue, GRSync, Areca Backup, etc.

Python as a high per­for­mance pro­gram­ming en­vi­ron­ment

Python is a widely used pro­gram­ming en­vi­ron­ment for al­most ev­ery ap­pli­ca­tion do­main in­clud­ing Big Data an­a­lyt­ics, wire­less net­works, cloud com­put­ing, the In­ter­net of Things (IoT), se­cu­rity tools, par­al­lel com­put­ing, ma­chine learn­ing, knowl­edge dis­cov­ery, deep learn­ing, NoSQL data­bases and many others. Python is a free and open source pro­gram­ming lan­guage which is equipped with in-built fea­tures of sys­tem pro­gram­ming, a high level pro­gram­ming en­vi­ron­ment and net­work com­pat­i­bil­ity. In addition, the in­ter­fac­ing of Python can be done with any chan­nel, whether it is live stream­ing on so­cial me­dia or in real-time via satel­lite. A num­ber of other pro­gram­ming lan­guages have been de­vel­oped, which have been in­flu­enced by Python. These lan­guages in­clude Boo, Co­bra, Go, Goovy, Ju­lia, OCaml, Swift, ECMAScript and Cof­feeScript. There are other pro­gram­ming en­vi­ron­ments with the base code and pro­gram­ming par­a­digm of Python un­der de­vel­op­ment.

Python is rich in main­tain­ing the repos­i­tory of pack­ages for big ap­pli­ca­tions and do­mains in­clud­ing im­age pro­cess­ing, text min­ing, sys­tems ad­min­is­tra­tion,

Web scrap­ing, Big Data anal­y­sis, data­base ap­pli­ca­tions, au­to­ma­tion tools, net­work­ing, video pro­cess­ing, satel­lite imag­ing, mul­ti­me­dia and many others.

Python Pack­age In­dex (PyPi): https://pypi.

The Python Pack­age In­dex (PyPi), which is also known as Cheese Shop, is the repos­i­tory of Python pack­ages for dif­fer­ent soft­ware mod­ules and plug­ins de­vel­oped as add-ons to Python. Till Septem­ber 2017, there were more

than 117,000 pack­ages for dif­fer­ent func­tion­al­i­ties and ap­pli­ca­tions in PyPi. This es­ca­lated to 123,086 pack­ages by Novem­ber 30, 2017.

The table in Fig­ure 1 gives the statis­tics fetched from Mo­d­, which main­tains data about mod­ules, plug­ins and soft­ware tools. Fig­ure 1: Statis­tics of mod­ules and pack­ages in PyPi in the last week of Novem­ber (Source:­d­ As Python has as­sorted tools and pack­ages for di­ver­si­fied ap­pli­ca­tions, se­cu­rity and backup tools with tremen­dous func­tion­al­i­ties are also in­te­grated in PyPi. De­scrip­tions of Python based key tools that of­fer se­cu­rity and integrity dur­ing backup fol­low.


Ro­tate-Back­ups is a sim­pli­fied com­mand line tool that is used for backup ro­ta­tion. It has mul­ti­ple fea­tures in­clud­ing flex­i­ble ro­ta­tions on par­tic­u­lar time­stamps and sched­ules.

The in­stal­la­tion process is quite simple. Give the fol­low­ing com­mand:

$ pip in­stall ro­tate-back­ups

The us­age is as fol­lows (the table at the bottom of this page lists the op­tions):

$ ro­tate-back­ups [Op­tions]

The ro­ta­tion ap­proach in Ro­tate-Back­ups can be cus­tomised as strict ro­ta­tion (en­force­ment of the time win­dow) or re­laxed ro­ta­tion (no en­force­ment of time win­dows).

Af­ter in­stal­la­tion, there are two files ~/.ro­tate-back­ups. ini and /etc/ro­tate-back­ups.ini which are used by de­fault.

This de­fault set­ting can be changed us­ing the com­mand line op­tion ­­con­fig.

The time­line and sched­ules of the backup can be spec­i­fied on the con­fig­u­ra­tion file as fol­lows:

# /etc/ro­tate-back­ups.ini: [/back­ups/my­lap­top] hourly = 24 daily = 7 weekly = 4 monthly = 12 yearly = al­ways ion­ice = idle [/back­ups/my­server] daily = 7 * 2 weekly = 4 * 2 monthly = 12 * 4 yearly = al­ways ion­ice = idle [/back­ups/myre­gion] daily = 7 weekly = 4 monthly = 2 ion­ice = idle [/back­ups/myxbmc] daily = 7 weekly = 4 monthly = 2

ion­ice = idle


Bak­that is a com­mand line tool with the func­tion­al­i­ties of cloud based back­ups. It has ex­cel­lent fea­tures to com­press, en­crypt and upload the files with a higher de­gree of integrity and se­cu­rity. Bak­that has many fea­tures of data backup with se­cu­rity, in­clud­ing com­pres­sion with tarfiles, en­cryp­tion us­ing BeeFish, up­load­ing of data to S3 and Gracier, lo­cal back­ups to the SQLite data­base, sync based back­ups and many others.

In­stal­la­tion is as fol­lows:

$ pip in­stall bak­that For source based in­stal­la­tion, give the fol­low­ing com­mands:

$ git clone­that.git $ cd bak­that

$ sudo python in­stall

For con­fig­u­ra­tion with the op­tions of se­cu­rity and cloud setup, give the com­mand:

$ bak­that con­fig­ure Us­age is as fol­lows: $ bak­that backup my­di­rec­tory To set up a pass­word, give the fol­low­ing com­mand:

$ BAKTHAT_PASSWORD=my­se­cu­ri­ty­pass­word bak­that my­backup my­doc­u­ment

You can re­store the backup as fol­lows: $ bak­that re­store my­backup $ bak­that re­store my­backup.tgz.enc For back­ing up a sin­gle file, type: $ bak­that backup /home/my­lo­ca­tion/my­file.txt To back up to Glacier on the cloud, type: $ bak­that backup my­file -d glacier

To dis­able the pass­word prompt, give the fol­low­ing com­mand:

$ bak­that my­backup mymy­file --prompt no


BorgBackup (or just Borg, for short) refers to a dedu­pli­cat­ing backup tool de­vel­oped in Python, which can be used in soft­ware frame­works or in­de­pen­dently. It pro­vides an ef­fec­tive way for se­cured backup and re­cov­ery of data.

The key fea­tures of BorgBackup in­clude the fol­low­ing: Space ef­fi­ciency

Higher speed and min­i­mum de­lays

Data en­cryp­tion us­ing 256-bit AES

Dy­namic com­pres­sion

Off-site back­ups

Back­ups can be mounted as a file sys­tem

Com­pat­i­ble with mul­ti­ple plat­forms

The com­mands that need to be given in dif­fer­ent dis­tri­bu­tions to in­stall BorgBackup are given be­low.

To ini­tialise a new backup repos­i­tory, use the fol­low­ing com­mand:

$ borg init -e re­pokey /PathRe­pos­i­tory To create a backup archive, use the com­mand given be­low: $ borg create /PathRe­pos­i­tory::Satur­day1 ~/MyDoc­u­ments

For an­other backup with dedu­pli­ca­tion, use the fol­low­ing code:

$ borg create -v --stats /path/to/repo::Satur­day2 ~/Doc­u­ments --------------------------------------------------------Archive name: MyArchive

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.