GithubHelp home page GithubHelp logo

chalaev / el-backup Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 60 KB

Simple backup system for linux. emacs-powered

License: GNU General Public License v3.0

Makefile 5.62% Shell 39.85% Emacs Lisp 54.54%
backup linux emacs-lisp

el-backup's Introduction

Table of Contents

  1. Requirements
  2. Quick Start
  3. Backup policy and features
  4. License

Simple backup system for Linux users who use emacs a lot.

Requirements

  1. emacs, mktemp, tar, gpg, grep, uniq (all available from standard linux packages),
  2. elisp part of my lisp-goodies project, and
  3. ~/.emacs.d/start.el (needed for emacsclient called in el-backup).

Quick Start

  1. Examine el-backup and common.sh (both supposed to run with root privileges).
    Create /usr/local/bin/el-backup/ and copy el-backup and common.sh there.
  2. Create /etc/el-backup/ and copy secret.conf and public.conf there. Edit global configuration files in /etc/el-backup/. Ensure that only root can read /etc/el-backup/secret.conf and that non-root users are allowed to read /etc/el-backup/public.conf.
  3. For each user enumerated in /etc/el-backup/secret.conf, copy el-backup.conf to ~/.emacs.d/conf/el-backup.conf and edit it.
  4. Create group tmp; the code uses it to mark temporary files.
  5. Copy packaged/backup.el to ~/.emacs.d/local-packages/. (~/.emacs.d/start.el will configure emacs to load backup.el from there.)
  6. Run /usr/local/bin/el-backup/el-backup daily with root privileges. This will create files X-Y-Z.tar.bz2 and X-Y-Z/user.list.gz (locally on your computer) where X, Y, Z are non-negative integers. Their encrypted copies in remote directory will be X-Y-Z.gpg and X-Y-Z.user.gpg

Backup policy and features

Only recently modified (later than the previous backup) files will be archived. This means that renamed or moved/downloaded files will not be queued for the next backup unless they have recent modification date. However, such files will be included in the next major archive.

A user can manually mark files in a directory as temporary by placing their name into the file .temp.files in the same directory. These files will be erased when they become older than two weeks.

By default non-text files are ignored; still binary files can be archived if

  • they have "white" extension, or
  • their group is "white", or
  • their (base) name is "white".

"White", "grey", and "black" lists can be configured in ~/.emacs.d/conf/el-backup.conf.

There is no special command to restore the files; the user is supposed to do it manually. Here is my way to do it:

  1. Decide if I prefer to use local of remote (encrypted) backup files.
  2. With zgrep utility, find the file in the list of archived files. Locate the archive with this file.
  3. If needed, decrypt the archive. Extract the file from the tar archive.

License

This code is released under GPL 3.0 license.

el-backup's People

Contributors

chalaev avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.