Giter VIP home page Giter VIP logo

backup-tool's Introduction

Backup tool

Linux tool for backing up data to a remote server using rsync.

Setup

  1. Ensure that ssh keys are properly set up between local and remote hosts.
  2. Create a backup directory called e.g. backup in your home directory.
  3. Copy the backup script to backup directory.
  4. Create directories you want to backup in the backup directory. In case you have already directories in other places, moving them to backup directory and symlinking to original locations might be a convenient solution.
  5. Copy sample configuration file .backup to backup directory and set correct remote host credentials and backup file list there.

Manual usage

The simplest way to use this tool is to manually execute backup when needed. This is done as follows:

$ cd ~/backup
$ ./backup

Files are restored in the following way:

$ cd ~/backup
$ ./backup restore

Using systemd timer

Backups can be automated using a systemd timer. For example, configuration in systemd user mode is done as follows:

  1. Copy systemd service and timer:

     $ cp systemd/* ~/.config/systemd/user/
     $ sudo systemctl --user enable oturpe-backup.timer
    
  2. Edit copied oturpe-backup.service file and set parameters WorkingDirectory and Exec to match the backup directory.

  3. Reload systemd daemon and enable timer:

     $ systemctl --user daemon-reload
     $ systemctl --user enable oturpe-backup.timer
    
  4. Check that the timer is running:

     $ systemctl --user status oturpe-backup.timer
     ● oturpe-backup.timer - Backup personal files daily
       Loaded: loaded (/home/otto/.config/systemd/user/oturpe-backup.timer; enabled;
       Active: active (waiting) since su 2017-06-04 12:30:05 CEST; 30min ago
     
     kesä 04 12:30:05 ottovain systemd[1525]: Started Backup personal files daily
    

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.