Skip to content

Creates a backup of a directory using tar and encrypts it with GPG using the default symmetric cipher of your GPG configuration. The encrypted backup file is tested wether or not it can be decrypted for data safety reasons. The password for all that has to be in a file. Make sure to "chmod 600" the password file!

License

Notifications You must be signed in to change notification settings

GlasFrost/backup_gpg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

backup_gpg

Creates a backup of a directory using tar and encrypts it with GPG using the default symmetric cipher of your GPG configuration. The encrypted backup file is tested wether or not it can be decrypted for data safety reasons. The password for all that has to be in a file. Make sure to "chmod 600" the password file!

Feel free to post bug reports and things like that in the bug tracker!

Usage

backup_gpg.sh

is the path to the password file. The first line of the file is used as password (according to GPG's man page)

is the path to the directory which you want to make a backup of. is the path to the directory the backup file will be stored in.

This script runs on linux machines. It was tested with Ubuntu 14.04 LTS using Bash.

How it works

The script uses tar to compress all the files (and the files in subdirs). The compressed output is piped to GPG which then encrypts the compressed data with the password given in the password file. Once encrypted the backup file is being checked wether it can be decrypted or something went wrong.

The final backup file is called "BACKUP_.tar.gz.gpg". In <source_path> all slashes (/) have been replaced with underscores () for obvious reasons. contains year, month, day, hour, minute and second (in exactly this order) of when the backup started.

DANGER!!!

You need to make sure that NOONE BUT YOU CAN EVER READ THE PASSWORD FILE!

"chmod 600" should do the trick for the most part.

And don't loose the password file if you want to be able to decrypt your data one day! You can print it out or write down the password to be safe.

About

Creates a backup of a directory using tar and encrypts it with GPG using the default symmetric cipher of your GPG configuration. The encrypted backup file is tested wether or not it can be decrypted for data safety reasons. The password for all that has to be in a file. Make sure to "chmod 600" the password file!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages