No description
This repository has been archived on 2026-07-02. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2020-01-09 00:10:28 +01:00
share added share folder to repo 2015-05-11 13:44:39 +02:00
.gitignore Cleanup, make compatible with Python3. 2016-05-28 12:31:56 +02:00
LICENSE.txt Rename LICENSE to LICENSE.txt 2016-06-01 09:58:02 +02:00
README.md Update 'README.md' 2020-01-09 00:10:28 +01:00
snotra.conf.sample Cleanup, make compatible with Python3. 2016-05-28 12:31:56 +02:00
snotra.py Fixed tiny bug in S3cmd command. 2016-08-03 23:19:46 +02:00

Snotra-backup

In Norse mythology, Snotra (Old Norse "clever") is a goddess associated with wisdom.

Snotra-backup is a backup script that uses duplicity and mysqldump to back up and encrypt files, folders and databases. It supports multiple backends, and it can synchronize the backups with Google Cloud Storage and/or Amazon AWS (untested). In addition you can write your own command that is executed when all backup definitions are done, that way you can move, copy or upload the files wherever. It is up to you.

Requirements

Python packages

  • configparser

Supported backends

  • file
  • ftp
  • rsync

Installation

Create symbolic link for shared library files:

$ sudo ln -s /path/to/snotra/share/ /usr/local/share/snotra

Create symbolic link in /usr/local/sbin folder, this is not required but will make Snotra system-wide available for the root user:

$ sudo ln -s /path/to/snotra/snotra.py /usr/local/sbin/snotra.py

Command-line arguments

Argument Action
-s, --show Show all commands, but do nothing.
-n, --dry-run Show that would have been done, but do nothing.
-c, --config <file> Run with the spesified config file.
-v Print version.

Config file

The config file is read from /etc/snotra/snotra.conf. A sample config is provided, make your changes and copy it to /etc/snotra/snotra.conf. See comments in snotra.conf.sample for parameters.

Cron job

Create file /etc/cron.d/snotra with the content below, this make will make Snotra run every night at 3:30:

MAILTO=root

# Run daily backup
30 3 * * * root [ -x /usr/local/sbin/snotra.py ] && /usr/local/sbin/snotra.py > /dev/null

Log file

Snotra-backup logs to /var/log/snotra.log by default, but this can be changed in the config file.

Log rotate

Since the log file can get pretty big over time it's wise to rotate it every now and then. Create file /etc/logrotate.d/snotra with the content below, this will make logrotate pick up the logfile:

/var/log/snotra.log {
        weekly
        rotate 4
        missingok
        compress
        delaycompress
        notifempty
        create 640 root adm
}

Duplicity operations

Verify

duplicity verify rsync://user@your.domain:1234//backup/etc /etc

List files

duplicity list-current-files rsync://user@your.domain:1234//backup/etc /etc

Restore

# Get latest
duplicity --file-to-restore apt/sources.list rsync://user@your.domain:1234//backup/etc /home/user/sources.list

# Get file from 4 days ago
duplicity -t 3D --file-to-restore apt/sources.list rsync://user@your.domain:1234//backup/etc /home/user/sources.list

Issues

The application is still work in progress so there may be bugs. Please report all bugs to the issue tracker on this repository.

Author

Thomas Jensen