Coder Social home page Coder Social logo

bota87 / docker-mssql-backup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bbtsoftware/docker-mssql-backup

0.0 0.0 0.0 31 KB

Docker image for periodic backups from a Microsoft SQL Server container

License: MIT License

Shell 87.28% Dockerfile 12.72%

docker-mssql-backup's Introduction

Docker image for backup of Microsoft SQL Server

Docker image to create regular backups of a Microsoft SQL Server image.

Information

Service Stats
Docker Build Pulls Stars Automated
GitHub Last commit Issues PR Size License

General

Topic Description
Image See Docker Hub.
Source See GitHub.

Usage

This container can create backups on a Microsoft SQL Server container.

NOTE: The backup is written to a directory /backup inside the Microsoft SQL Server container, not to a volume in the backup container. For using the cleanup feature attach the same /backup volume in the bbtsoftwareag/mssql-backup container.

Tags

Tag Description Size
latest Latest master build Size
0.1.0 Release 0.1.0 Size
0.2.0 Release 0.2.0 Size
0.3.0 Release 0.3.0 Size
0.4.0 Release 0.4.0 Size

Configuration

These environment variables are supported:

Environment variable Default value Description
DB_SERVER mssql Name or address of the database server to backup. Normally this should be the name of the Microsoft SQL Server service.
DB_USER SA User used to connect to the database server.
DB_PASSWORD Password used to connect to the database server.
DB_NAMES Names of the databases for which a backup should be created.
TZ Timezone to use.
CRON_SCHEDULE 0 1 * * sun Cron schedule for running backups. NOTE: There is no check if there's already a backup running when starting the backup job. Therefore time interval needs to be longer than the maximum expected backup time for all databases.
BACKUP_CLEANUP false Set to "true" if you want to let the cronjob remove files older than $BACKUP_AGE days
BACKUP_AGE 7 Number of days to keep backups in backup directory
SKIP_BACKUP_LOG false Skip step to backup the transaction log .
PACK Possible values: tar, zip. If defined, compresses the output files into a single .tar.gz (or zip)-File.
ZIP_PASSWORD Sets the password for the zip to the given value. Only works if PACK is set to zip
PUSH_REMOTE_MODE The possible values move or copy activates pushing the backup files to a mapped remote directory. The volume remote must be mapped.
SMTP_HOST If this is set, email reporting is enabled by sending the results of the backup process to MAIL_TO. You pretty much have to define all the other SMTP_* variables, when the host is defined.
SMTP_PORT The port of the SMTP server
SMTP_USER The username used to login against the SMTP server
SMTP_PASS The password for connecting to the SMTP server
SMTP_FROM The E-mail address from which mails should be sent from
SMTP_TLS on Whether TLS should be used when connecting to the SMTP server
MAIL_TO The target E-mail address for receiving mail reports

Examples

Docker Compose

The following example will create backups of the databases MyFirstDatabaseToRestore and MySecondDatabaseToRestore running inside the db container every day at 01.00 CEST and stores it in the /storage/backup directory on the host machine.

version: '3.7'

services:
  db:
    image: mcr.microsoft.com/mssql/server
    volumes:
      - /storage/backup:/backup
    environment:
      - ACCEPT_EULA=Y
      - MSSQL_PID=Express
      - SA_PASSWORD=MySecre(12)tPassword
    networks:
      - default
  backup:
    image: bbtsoftwareag/mssql-backup
    # for using the cleanup feature, use the backup volume from db.
    # volumes:
    #   - /storage/backup:/backup
    environment:
      - TZ=Europe/Zurich
      - DB_SERVER=db
      - DB_USER=SA
      - DB_PASSWORD=MySecre(12)tPassword
      - "DB_NAMES=
          MyFirstDatabaseToRestore
          MySecondDatabaseToRestore"
      - CRON_SCHEDULE=0 1 * * *
    networks:
      - default

Example environment

We added a small docker environment in the example subdirectory for development or tests with a own readme file.

Discussion

For questions and to discuss ideas & feature requests, use the GitHub discussions on the BBT Software docker-mssql-backup repository.

Join in the discussion on the BBT Software docker-mssql-backup repository

Contributing

Contributions are welcome. See Contribution Guidelines.

docker-mssql-backup's People

Contributors

dependabot-preview[bot] avatar eoehen avatar pascalberger avatar stefangweichinger avatar wittsend 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.