Skip to content

assailance/backup-scripts

Repository files navigation

Simple bash scripts for creating backups and sending them to Telegram.

🔩 Running scripts

To use any script, make the file executable:

chmod +x backup-folder.sh
chmod +x backup-docker-volume.sh
chmod +x backup-docker-postgres.sh

Backup folder

You must specify the backup name and path to the directory.

Usage:

backup-folder.sh <backup_name> <directory_path>

Examples:

backup-folder.sh Name ./images
backup-folder.sh "Few words" /var/log/nginx

Backup volume (Docker)

You must specify the volume name. The script will automatically check if it exists.

Usage:

backup-docker-volume.sh <docker_volume>

Examples:

backup-docker-volume.sh pg-data
backup-docker-volume.sh random-volume  # Docker volume does not exist: random-volume

Backup postgres (Docker)

You must specify the container name (or id), database name, and user name.

Usage:

backup-docker-postgres.sh <postgres_container> <db_name> <db_user>

Examples:

backup-docker-volume.sh 5cee88979da6 my-database my-user
backup-docker-volume.sh random-name db user  # Docker container does not exist: random-name

Warning

When backing up a directory or a Docker volume, the data may be actively modified at the time of backup (for example by an application, service, or database).

In such cases, the backup:

  • may contain partially written files
  • may become inconsistent
  • may fail to restore correctly later

🖼️ Other images

About

Bash scripts for creating backups and sending them to Telegram chat.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages