June 2005 Archives

Linux user home directory backup script

| | Comments (0)

So, due to my inability to prefix a command with a "/", I recently lost most of my home directory. So, I was prompted to write a backup management script. My only problem was I wanted the ability to NOT backup certain directores (I really don't need to backup the kernel source four times), and I wanted the final result gpg encrypted. So, I present you with backup.sh. When called, it scans $HOME for .nobackup files, and adds the directory to the exclude list for the backup. It then creates, if it doesn't exist already, $HOME/.backups, and $HOME/.backups/.nobackup (there's no point in backing up backups, over and over). The backup is in a timestamped .tar.gz, and if $HOME/.backups/gpgkey exists (and contains something like, "0x057F140A", no trailing newline, less quotes), it will then encrypt the backup and rm the .tar.gz (no longer needed).

backup.sh

About this Archive

This page is an archive of entries from June 2005 listed from newest to oldest.

March 2005 is the previous archive.

August 2005 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.0