Detailed explanation of using attic to manage backup data in Linux

Time:2022-4-22

Attic is a backup program written in Python to delete duplicate data. Its main goal is to provide an efficient and safe data backup method. The use of data De duplication technology makes attic suitable for daily backup because it can store only those modified data.
Attic characteristics
Space efficient storage

Variable block size de duplication technology is used to reduce the number of redundant data storage bytes detected. Each file is divided into several variable length blocks, and only those never seen will be compressed and added to the warehouse.
Optional data encryption

All data can be protected with 256 bit AES encryption, and hmac-sha256 is used to verify data integrity and authenticity.
Off site backup

Attic can store data to the remote host installed with attic through SSH.
Backups can be mounted as file systems

The backup archive can be mounted as a user space file system for easy verification and recovery of backups.
Installing attic to Ubuntu 14.10

Open the terminal and run the following command

   

Copy code

The code is as follows:

sudo apt-get install attic

Using attic
Hands on example teaching

Before backup, initialize the warehouse:

   

Copy code

The code is as follows:

$ attic init /somewhere/my-repository.attic

Back up the ~ / SRC and ~ / documents directories to an archive named Monday:

   

Copy code

The code is as follows:

$ attic create /somwhere/my-repository.attic::Monday ~/src ~/Documents

The next day, create a new archive called Tuesday:

   

Copy code

The code is as follows:

$ attic create –stats /somwhere/my-repository.attic::Tuesday ~/src ~/Documents

The backup will be faster and smaller because only new data that has never been seen before will be stored– The stats option allows attic to output statistics about the newly created archive, such as the number of unique data (not shared with other archives):

   

Copy code

The code is as follows:

Archive name: Tuesday
Archive fingerprint: 387a5e3f9b0e792e91e91ce87134b0f4bfe17677d9248cb5337f3fbf3a8e157942a
Start time: Tue Mar 25 12:00:10 2014
End time: Tue Mar 25 12:00:10 2014
Duration: 0.08 seconds
Number of documents: 358
Initial size compressed size deduplicated size
This Archive: 57.16 MB 46.78 MB 151.67 KB
All archives: 114.02 MB 93.46 MB 44.81 MB

List all archives in the warehouse:

   

Copy code

The code is as follows:

$ attic list /somewhere/my-repository.attic

Monday Mon Mar 24 11:59:35 2014
Tuesday Tue Mar 25 12:00:10 2014

List the contents of the Monday Archive:

   

Copy code

The code is as follows:

$ attic list /somewhere/my-repository.attic::Monday

drwxr-xr-x user group 0 Jan 06 15:22 home/user/Documents
-rw-r–r– user group 7961 Nov 17 2012 home/user/Documents/Important.doc

Restore the Monday Archive:

   

Copy code

The code is as follows:

$ attic extract /somwhere/my-repository.attic::Monday

Restore disk space by manually deleting the Monday Archive:

   

Copy code

The code is as follows:

$ attic delete /somwhere/my-backup.attic::Monday

Please refer to attic documentation for details.